*This do file creates tables from stored estimate files created on IRS servers

clear all
set more off
set matsize 11000
set emptycells drop

*The directory path has been replaced with "****"
global path "****/Results"
global output "****/Tables"



/* =================================================
Table I: Summary Statistics and Balance Checks
==================================================*/

local individual female age_2017 age0_18 age19_26 age27_44 age45_64 age65plus
local household married income fpl_frac fpl_frac138 fpl_frac138_400 fpl_frac400 tot_exmpt
local local hsorhigher baorhigher expansion SBM 
local penalty exempt2014 penalty_2014d penalty_2014 exempt2015 penalty_2015d penalty_2015 penalty 
local cov2015 any_covered2015 covered2015 full_year_2015
local cov2016 any_covered2016_first11 covered2016_first11 full_2016_first11
local count ind_count hh_count

estimates clear
estimates use "$path/Estimates/covariate_balance_081120.ster"

local f_test_pvalue =  Ftail(e(df_m),e(df_r),e(F)) 
local f_test_pvalue: di %05.3f `f_test_pvalue'

estimates clear
estimates use "$path/Estimates/sum_stats_main_081120.ster"

local semicolon = ";"

#delimit ;
global mean_format "%10.3fc %10.1fc %10.3fc %10.3fc %10.3fc %10.3fc %10.3fc
					%10.3fc %10.0fc  %10.3fc %10.2fc %10.3fc 
					%10.3fc %10.3fc %10.3fc %10.3fc 
					%10.3fc %10.3fc %10.0fc %10.3fc %10.3fc %10.0fc %10.0fc
					%10.3fc %10.2fc %10.3fc 
					%10.3fc %10.2fc %10.3fc 
					%10.0fc %10.0fc" ;

esttab using "$output/Summary Statistics.tex", replace
	booktabs nogaps label noobs collabels(none) nonumber eqlabels(none) nomtitles 
	cells("dset1 (fmt($mean_format)) dset2 (fmt($mean_format)) blank mu (fmt($mean_format)) mu1 (fmt($mean_format)) mu0 (fmt($mean_format)) d_p (fmt(%10.3fc)) ") 
	prehead(\begin{table}[htbp]                 
			\caption{Summary Statistics and Balance Checks}      
			\makebox[\textwidth][c]{
			\centering                                      
			\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}                        
			\begin{tabular}{l*{1}{ccccccc}}                     
			\toprule
			&\multicolumn{1}{c}{(1)}        & \multicolumn{1}{c}{(2)}   & \multicolumn{1}{c}{} &      \multicolumn{1}{c}{(3)} &  \multicolumn{1}{c}{(4)}  & \multicolumn{1}{c}{(5)} &  \multicolumn{1}{c}{(6)} \\                            
			\cmidrule(lr){2-8}
			& \multicolumn{1}{c}{All} & \multicolumn{1}{c}{No Full-} & \multicolumn{5}{c}{Experimental Sample} \\ \cmidrule(lr){5-8} & \multicolumn{1}{c}{Taxpayers} &  \multicolumn{1}{c}{Year}   & \multicolumn{1}{c}{} & \multicolumn{1}{c}{All}  & \multicolumn{1}{c}{Treatment}  & \multicolumn{1}{c}{Control} & \multicolumn{1}{c}{Difference}  \\                 
			& \multicolumn{1}{c}{} &  \multicolumn{1}{c}{Coverage}   & \multicolumn{1}{c}{} & \multicolumn{1}{c}{}  & \multicolumn{1}{c}{}  & \multicolumn{1}{c}{} & \multicolumn{1}{c}{p-value} \\                 
			\midrule) 
	varl(female 		  "\hspace{0.2cm} Female"
		 age_2017 		  "\hspace{0.2cm} Age"
		 age0_18 		  "\hspace{0.6cm} 0 - 18"
		 age19_26 		  "\hspace{0.6cm} 19 - 26"
		 age27_44		  "\hspace{0.6cm} 27 - 45"
		 age45_64 		  "\hspace{0.6cm} 45 - 64"
		 age65plus 	  	  "\hspace{0.6cm} 65 or older \vspace{0.2 cm}"
		 
		 married 		  "\hspace{0.2cm} Married"
		 income 		  "\hspace{0.2cm} Household income"
		 fpl_frac138	  "\hspace{0.2cm} Income $<$ 138\% FPL"
		 tot_exmpt 	  	  "\hspace{0.2cm} Household size"
		 self_prepared	  "\hspace{0.2cm} Self-Prepared Returns  \vspace{0.2 cm}"	

		 hsorhigher 	  "\hspace{0.2cm} High school degree or higher"
		 baorhigher 	  "\hspace{0.2cm} BA degree or higher "
		 expansion  	  "\hspace{0.2cm} Expansion state"
		 SBM 		 	  "\hspace{0.2cm} State-based marketplace \vspace{0.2 cm}"
		
		 exempt2014       "\hspace{0.2cm} Claimed 2014 exemption"
		 penalty_2014d    "\hspace{0.2cm} Paid 2014 penalty"
		 penalty_2014     "\hspace{0.2cm} 2014 penalty if penalized"
		 exempt2015       "\hspace{0.2cm} Claimed 2015 exemption"
		 penalty_2015d    "\hspace{0.2cm} Paid 2015 penalty"
		 penalty_2015     "\hspace{0.2cm} 2015 penalty if penalized"
		 penalty 		  "\hspace{0.2cm} Projected 2017 annualized penalty \vspace{0.2 cm}"

		 any_covered2015  "\hspace{0.2cm} Any coverage"
		 covered2015 	  "\hspace{0.2cm} Covered months"
		 full_year_2015   "\hspace{0.2cm} Full-year coverage \vspace{0.2 cm}"

		 any_covered2016_first11  "\hspace{0.2cm} Any coverage"
		 covered2016_first11 	  "\hspace{0.2cm} Covered months"
		 full_2016_first11   "\hspace{0.2cm} Full-year coverage \vspace{0.2 cm}"
		 
		 ind_count 	  	  "\hspace{0.2cm} Individuals"
		 hh_count  	      "\hspace{0.2cm} Households")
		
	refcat(female "\emph{Individual characteristics}"
		   married "\emph{Household characteristics}" 
		   hsorhigher "\emph{Local characteristics}" 
		   exempt2014 "\emph{Penalty}" 
		   any_covered2015 "\emph{2015 coverage (Jan-Dec)}" 
		   any_covered2016_first11 "\emph{2016 coverage (Jan-Nov)}" 
		   ind_count "\emph{Observations}", nolabel) 
	postfoot(\\
			Joint test (\emph{p-value})&  & &            &  &  &   &    `f_test_pvalue'        \\
			\midrule      
			\multicolumn{8}{p{7.5in}}{\tiny{\emph{Notes:}	Te table presents summary statistics for a 1\% random sample of 2015 tax returns
			(column 1), the set of 2015 tax returns that did not report full-year coverage (column 2), and the set of 2015 tax returns included in
			the experimental sample (columns 3-5). Column 6 reports the p-value for the test of equality between the treatment and control groups,
			with standard errors clustered by household. The joint test p-value corresponds to the null of equality between the treatment and
			control groups for all reported characteristics. All statistics are calculated at the individual level. Age refers to the
			individual's age at the end of 2015. Local characteristics are imputed based on the zip code corresponding to the individual's
			2015 tax return. Household refers to the taxpayers and dependents listed on the individual's 2015 tax return`semicolon' household characteristics
			are derived from information reported on that return. Income refers to modified adjusted gross income. FPL refers to the applicable federal
			poverty line, calculated from the household size and state corresponding to the 2015 tax return. Self-prepared return indicates whether the
			2015 tax return was prepared by a third-party preparer. The projected 2017 annualized penalty refers to the estimated individual mandate
			penalty a household would owe if all household members lacked coverage during 2017, based on household size, location, and income reported 
			in 2015. Local characteristics are imputed based on the zip code corresponding to the individual's 2015 tax return. Expansion state refers 
			to whether the reported state of residence had expanded Medicaid as of January 1, 2017. Coverage is measured from Form 1095 A/B/C. For 2015 
			coverage: any coverage indicates one or more month of coverage during the year`semicolon' covered months refers to the number of months of the year in
			which the individual was enrolled in coverage`semicolon' and full-year coverage indicates the individual was enrolled in 12 months of coverage during 
			the year. For 2016 coverage, these measures are defined analogously except they are defined based on coverage during the first 11 months of the year.}}        
			\end{tabular}                                            
			}
			\end{table}) ;
#delimit cr 
 
 
/* ================================
Table II: Coverage Effect by Prior-Year Insurance
===================================*/


estimates clear
forval c = 1/12 {
	estimates use "$path/Estimates/cov_effect_051620.ster", number(`c')
	eststo c`c'
}

local semicolon= ";"

#delimit ;
esttab c2 c1 c4 c3 c6 c5 using "$output/Coverage Effect by Past Year Coverage.tex", replace 
	b(3) se(3) transform(@*100 100, pattern(0 1 0 1 0 1)) 
	nostar booktabs nogaps label noobs eqlabels(none) nonumbers nomtitles nodepvars collabels(none) mgroups(none)
	keep(treatment)  varl(treatment "Treated")  
	stats (ymean N, fmt(3 %15.0fc) label("Control mean" "Observations"))  
	prehead(\begin{table}[htbp]          
			\caption{Coverage Effect by Prior-Year Insurance}          
			\centering              
			\begin{tabular}{l*{6}{c}}
			\toprule                
			& \multicolumn{1}{c}{(1)} &  \multicolumn{1}{c}{(2)} & \multicolumn{1}{c}{(3)} & \multicolumn{1}{c}{(4)} & \multicolumn{1}{c}{(5)} & \multicolumn{1}{c}{(6)} \\ 
			\cmidrule(lr){2-7}                     
			& \multicolumn{2}{c}{Full} & \multicolumn{2}{c}{Prior-Year}  & \multicolumn{2}{c}{Prior-Year} \\
			& \multicolumn{2}{c}{Sample} & \multicolumn{2}{c}{Insured} & \multicolumn{2}{c}{Uninsured}  \\  
			\cmidrule(lr){2-3} \cmidrule(lr){4-5} \cmidrule(lr){6-7} 
			& \multicolumn{1}{c}{Months of} & \multicolumn{1}{c}{Any}  & \multicolumn{1}{c}{Months of} & \multicolumn{1}{c}{Any} & \multicolumn{1}{c}{Months of} & \multicolumn{1}{c}{Any} \\
			& \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Coverage} \\ 
			\midrule
			\multicolumn{7}{c}{Panel A: All Ages} \\ 
			\midrule)
	postfoot(\midrule);

esttab c8 c7 c10 c9 c12 c11 using "$output/Coverage Effect by Past Year Coverage.tex", append
	b(3) se(3) transform(@*100 100, pattern(0 1 0 1 0 1)) 
	nostar booktabs nogaps label noobs eqlabels(none) nonumbers nomtitles nodepvars collabels(none) mgroups(none)
	keep(treatment)  varl(treatment "Treated")  
	stats (ymean N, fmt(3 %15.0fc) label("Control mean" "Observations"))  
	prehead(\multicolumn{7}{c}{Panel B: Middle Age Adults} \\ 
			\midrule)
	postfoot(\midrule                  
			\multicolumn{7}{p{6.25in}}{\footnotesize{\emph{Notes:} The table reports the effect of the intervention on health insurance coverage enrollment. In columns 1, 3, and 5, the outcome is months of
			coverage during 2017-18. In columns 2, 4, and 6, the outcome indicates enrollment in one or more month of coverage during 2017-18`semicolon' units are percentage points (0-100). Columns 3 and 4 limit the
			analysis to individuals enrolled in coverage during each of the first 11 months of 2016. Columns 5 and 6 limit the analysis to individuals that were not enrolled in coverage during at least one
			of the first 11 months of 2016. Panel B limits the analysis to individuals between the ages of 45 and 64 at the end of 2017. Standard errors, reported in parentheses, are clustered by household.  }}        
			\end{tabular}
			\end{table});
#delimit cr




/* ======================================
Table III: Coverage Effect by Type of Coverage
=========================================*/

estimates clear
eststo clear
forval c = 1/12 {
	estimates use "$path/Estimates/type_of_coverage_051620.ster", number(`c')
	eststo c`c'
}

#delimit ;
esttab c1 c3 c5 c7 c9 c11 using "$output/Coverage (Intensive) Effect by Type of Coverage.tex", replace
	nogaps label noobs eqlabels(none)  nonumbers nomtitles 
	b(3) se(3) 
	nostar
	keep(treatment)  varl(treatment "Treated")  
	stats (ymean N, fmt(3 %15.0fc) label("Control mean" "Observations"))
	prehead(\begin{table}[htbp]\centering
			\caption{Coverage Effect by Type of Coverage}
			\begin{tabular}{l*{6}{c}}
			\toprule
			& \multicolumn{1}{c}{(1)}          & \multicolumn{1}{c}{(2)}      & \multicolumn{1}{c}{(3)} & \multicolumn{1}{c}{(4)}  & \multicolumn{1}{c}{(5)} & \multicolumn{1}{c}{(6)} \\ \cmidrule(lr){2-7}     
			& \multicolumn{1}{c}{Exchange} & \multicolumn{1}{c}{Medicaid} & \multicolumn{1}{c}{ESI} & \multicolumn{1}{c}{Off-Exchange}  & \multicolumn{1}{c}{VA} & \multicolumn{1}{c}{Medicare} \\
			\midrule
			\multicolumn{7}{c}{Panel A: All Ages} \\ 
			\midrule) 
	postfoot(\midrule);
#delimit cr	 

estimates clear
eststo clear
forval c = 1/12 {
	estimates use "$path/Estimates/type_of_coverage_4564_051620.ster", number(`c')
	eststo c`c'
}

#delimit ;
esttab c1 c3 c5 c7 c9 c11 using "$output/Coverage (Intensive) Effect by Type of Coverage.tex", append
	nogaps label noobs eqlabels(none)  nonumbers nomtitles 
	b(3) se(3) 
	nostar
	keep(treatment)  varl(treatment "Treated")  
	stats (ymean N, fmt(3 %15.0fc) label("Control mean" "Observations"))
	prehead(\multicolumn{7}{c}{Panel B: Middle Age Adults} \\ 
			\midrule)
	postfoot(\midrule 		
			\multicolumn{7}{p{6.25in}}{\footnotesize{\emph{Notes:} The table reports the effect of the intervention on specific forms of health insurance coverage. The outcome is the number of
			months of the specified form of coverage enrolled in during 2017-18.  ESI refers to employer-sponsored coverage. Off-Exchange refers to individual coverage not purchased through the
			Exchange. VA refers to coverage provided through the Veterans Administration. Panel B limits the analysis to individuals between the ages of 45 and 64 at the end of 2017. All
			columns exclude individuals with full coverage in January through November of 2016. Standard errors, reported in parentheses, are clustered by household. }}        
			\end{tabular}
			\end{table}) ;
#delimit cr	 




/* ===================================
Table IV: Effects of Intervention and Coverage on Middle Age Mortality
======================================*/

eststo clear
estimates clear

forval c = 1/4{
	estimates use "$path/Estimates/2sls_main_052920.ster", number(`c')
	eststo c`c'
}	

local semicolon= ";"

* .tex
#delimit ;
esttab c3 c1 c2 c4 using "$output/Mortality Effect.tex", replace 
	nogaps label noobs eqlabels(none) collabel(none) nonumber nomtitles  
	b(3) se(3) transform(@*100 100, pattern(1 1 0 1)) 
	nostar
	keep(covered1718 treatment) 
	varl(covered1718 "Covered Months" treatment "Treated")  
	order(treatment covered1718)
	stats (ymean N, fmt(3 %15.0fc) label("Control mean" "Observations")) 
	prehead(\begin{table}[htbp]\centering                 
			\caption{Effects of Intervention and Coverage on Middle Age Mortality}                         
			\begin{tabular}{l*{4}{c}}                  
			\toprule
			& \multicolumn{1}{c}{(1)} &  \multicolumn{1}{c}{(2)}  &  \multicolumn{1}{c}{(3)} &  \multicolumn{1}{c}{(4)}  \\                       
			\cmidrule(lr){2-5}        
			& \multicolumn{1}{c}{Mortality} & \multicolumn{1}{c}{Mortality} & \multicolumn{1}{c}{Coverage}  & \multicolumn{1}{c}{Mortality} \\
			& \multicolumn{1}{c}{(Reduced Form)}  & \multicolumn{1}{c}{(OLS)} & \multicolumn{1}{c}{(First Stage)} & \multicolumn{1}{c}{(IV)} \\
			\midrule)
	postfoot(\midrule 
			\multicolumn{5}{p{5.75in}}{\footnotesize{\emph{Notes:} The table reports analyses relating to the effect of the intervention on mortality and to the effect of coverage on mortality.
			In Columns 1, 2, and 4, the outcome indicates mortality during 2017-18`semicolon' units are percentage points (0-100). In Column 3, the outcome is months of coverage during 2017-18. Column 1
			reports the intent-to-treat effect of the intervention on mortality. Column 2 reports results from an ordinary least squares regression of mortality on 2017-18 coverage-months. Column 3
			reports the first stage for the IV estimate`semicolon' the effect of the intervention on months of coverage during 2017-18. Column 4 reports the effect of coverage on mortality obtained by
			instrumenting for months of 2017-18 coverage with an indicator for treatment group assignment. All columns limit the analysis to individuals between the ages of 45 and 64 at the end of
			2017 and exclude individuals with full coverage in January through November of 2016. Standard errors, reported in parentheses, are clustered by household.}}
			\end{tabular}                                            
			\end{table});
#delimit cr	


****************************Appendix Tables*************************************


/* ======================================================================
Table A.II: Sample Allocation by Treatment Arm
=========================================================================*/

estimates clear
estimates use "$path/Estimates/sum_stats_counts_ind_062420.ster"
matrix ind = [e(b)]'

estimates clear
estimates use "$path/Estimates/sum_stats_counts_hh_062420.ster"
matrix hh_count = [e(b)]'

estimates clear
estimates use "$path/Estimates/sum_stats_frac_hh_062420.ster"
matrix hh_frac = [e(b)]'

mat results = ind, hh_count, hh_frac

#delimit ;
esttab matrix(results, fmt(%12.0fc %12.0fc %12.2fc)) ///
	using "$output/Sample Allocation by Arm.tex", replace 
	booktabs nogaps label noobs nomtitles collabels(none) nonumber eqlabels(none) 
	prehead(\begin{table}[htbp]\centering
			\caption{Sample Allocation by Treatment Arm}
			\begin{tabular}{l*{3}{c}}
			\toprule
			& \multicolumn{1}{c}{(1)}    & \multicolumn{1}{c}{(2)}  &  \multicolumn{1}{c}{(3)} \\ \cmidrule(lr){2-4}
			& \multicolumn{1}{c}{Individuals} & \multicolumn{1}{c}{Households} & \multicolumn{1}{c}{Share}\\		
			\midrule)  
	varl(c1 "Overall" 
		 c2 "Treatment" 
		 c3 "Control \vspace{0.2cm}"
		 c4 "\hspace{0.3cm} Base"
		 c5 "\hspace{0.3cm} Early"
		 c6 "\hspace{0.3cm} Non-Personalized"
		 c7 "\hspace{0.3cm} Exemption info \vspace{0.2cm}"
		 c8 "\hspace{0.3cm} English only"
		 c9 "\hspace{0.3cm} English + Spanish \vspace{0.2cm}")
	refcat(c4 "\emph{Treatment arm}" c8 "\emph{Language}", nolabel) 
	postfoot(\midrule                           
			\multicolumn{4}{p{4.5in}}{\footnotesize{\emph{Notes:} The table reports the assignment of individuals and households across treatment arms. The base treatment was personalized, did not include information about
			applying for an exemption, and was sent during the mid-January mailing. The shares reported in column 3 are calculated at the household level. Households correspond to the individuals listed on a tax return. }}
			\end{tabular}
			\end{table}) ;
#delimit cr 


/* ====================================================
Table A.III: Summary Statistics for Non-Filers
=======================================================*/

clear all 
use "$path/Data/non_filers_sum_stats_062220.dta"
mkmat non_filer1, matrix(non_filers)

estadd mat c1 = [non_filers]' 

#delim ;
esttab using "$output/Summary Stats - Non-Filers.tex", cells("c1(fmt(3 3 3 3 3 3 %15.0fc))") noobs
		collabels(none) nomtitles replace nonumber 
		prehead(\begin{table}[htbp]\centering              
			\caption{Summary Statistics for Non-Filers}                  
			\begin{tabular}{l*{1}{c}}                   
			\toprule                                
			& \multicolumn{1}{c}{Non-Filer Sample} \\    
			\midrule)
		varl(r1 "Female" 
			 r2 "Age" 
			 r3 "Income" 
			 r4 "\hspace{0.3cm} Any Coverage" 
			 r5 "\hspace{0.3cm} Covered Months"  
			 r6 "\hspace{0.3cm} Full-year Coverage"
			 r7 "\midrule \textbf{Observations}") 
			 nonumber 
		refcat(r4 "\emph{2015 Coverage}", nolabel)
		postfoot(\midrule 
				\multicolumn{2}{p{3.5in}}{\footnotesize{\emph{Notes:} The table provides summary statistics for the universe of individuals that did not file a 2015 tax return and that were listed on a 2015 information return.
				The sample is limited to individuals that were between the ages of 19-64 at the end of 2015. Income is derived from information returns reported to the IRS for 2015. Coverage is measured from Forms 1095 A/B/C
				submitted to the IRS for the applicable year. Any coverage indicates one or more month of coverage during 2015. Covered months indicates the number of months of coverage the individual enrolled in during 2015.
				Full-year coverage indicates the individual was enrolled in 12 months of coverage during 2015.}}
				\end{tabular}                                            
				\end{table});	
				
#delimit cr	



/* ================================
Table A.IV: Coverage Effect by Prior-Year Insurance with Demographic and Geographic Controls
===================================*/


estimates clear
forval c = 1/12 {
	estimates use "$path/Estimates/cov_controls_062220.ster", number(`c')
	eststo c`c'
}

#delimit ;
esttab c2 c1 c4 c3 c6 c5 using "$output/Coverage Effect by Past Year Coverage - Controls.tex", replace 
	b(3) se(3) transform(@*100 100, pattern(0 1 0 1 0 1)) 
	nostar booktabs nogaps label noobs eqlabels(none) nonumbers nomtitles nodepvars collabels(none) mgroups(none)
	keep(treatment)  varl(treatment "Treated")  
	stats (ymean N, fmt(3 %15.0fc) label("Control mean" "Observations"))  
	prehead(\begin{table}[htbp]          
			\caption{Coverage Effect by Prior-Year Insurance with Demographic and Geographic Controls}          
			\centering              
			\begin{tabular}{l*{6}{c}}
			\toprule                
			& \multicolumn{1}{c}{(1)} &  \multicolumn{1}{c}{(2)} & \multicolumn{1}{c}{(3)} & \multicolumn{1}{c}{(4)} & \multicolumn{1}{c}{(5)} & \multicolumn{1}{c}{(6)} \\ 
			\cmidrule(lr){2-7}                     
			& \multicolumn{2}{c}{Full} & \multicolumn{2}{c}{Prior-Year}  & \multicolumn{2}{c}{Prior-Year} \\
			& \multicolumn{2}{c}{Sample} & \multicolumn{2}{c}{Insured} & \multicolumn{2}{c}{Uninsured}  \\  
			\cmidrule(lr){2-3} \cmidrule(lr){4-5} \cmidrule(lr){6-7} 
			& \multicolumn{1}{c}{Months of} & \multicolumn{1}{c}{Any}  & \multicolumn{1}{c}{Months of} & \multicolumn{1}{c}{Any} & \multicolumn{1}{c}{Months of} & \multicolumn{1}{c}{Any} \\
			& \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Coverage} \\ 
			\midrule
			\multicolumn{7}{c}{Panel A: All Ages} \\ 
			\midrule)
	postfoot(\midrule);

esttab c8 c7 c10 c9 c12 c11 using "$output/Coverage Effect by Past Year Coverage - Controls.tex", append
	b(3) se(3) transform(@*100 100, pattern(0 1 0 1 0 1)) 
	nostar booktabs nogaps label noobs eqlabels(none) nonumbers nomtitles nodepvars collabels(none) mgroups(none)
	keep(treatment)  varl(treatment "Treated")  
	stats (ymean N, fmt(3 %15.0fc) label("Control mean" "Observations"))  
	prehead(\multicolumn{7}{c}{Panel B: Middle Age Adults} \\ 
			\midrule)
	postfoot(\midrule                  
			\multicolumn{7}{p{6.75in}}{\footnotesize{\emph{Notes:} The table reports the effect of the intervention on health insurance coverage enrollment from specifications that control for pre-randomization demographic
			and geographic covariates. Apart from the presence of controls, the reported analyses correspond to those reported in Table _. All columns control for age fixed effects, gender, marital status, 2016 insurance
			coverage, 2015 household income relative to the federal poverty line, mean 2016 state-level mortality, penalty payment in 2014, an indicator for being exempt from the penalty in 2014, and logged zip code-level measures from the American Communities Survey for median
			income, share of Spanish speakers, and share of college graduates. Missing values in control variables are replaced with zero and an additional variable is included to indicate missingness. }}        
			\end{tabular}
			\end{table});
#delimit cr


/* ================================
Table A.V: Coverage Effect by Prior-Year Insurance with Randomization Strata Controls
===================================*/


estimates clear
forval c = 1/12 {
	estimates use "$path/Estimates/cov_effect_cluster1_051820.ster", number(`c')
	eststo c`c'
}

#delimit ;
esttab c2 c1 c4 c3 c6 c5 using "$output/Coverage Effect by Past Year Coverage - Randomization Blocks.tex", replace 
	b(3) se(3) transform(@*100 100, pattern(0 1 0 1 0 1)) 
	nostar booktabs nogaps label noobs eqlabels(none) nonumbers nomtitles nodepvars collabels(none) mgroups(none)
	keep(treatment)  varl(treatment "Treated")  
	stats (ymean N, fmt(3 %15.0fc) label("Control mean" "Observations"))  
	prehead(\begin{table}[htbp]          
			\caption{Coverage Effect by Prior-Year Insurance with Randomization Strata Controls}          
			\centering              
			\begin{tabular}{l*{6}{c}}
			\toprule                
			& \multicolumn{1}{c}{(1)} &  \multicolumn{1}{c}{(2)} & \multicolumn{1}{c}{(3)} & \multicolumn{1}{c}{(4)} & \multicolumn{1}{c}{(5)} & \multicolumn{1}{c}{(6)} \\ 
			\cmidrule(lr){2-7}                     
			& \multicolumn{2}{c}{Full} & \multicolumn{2}{c}{Prior-Year}  & \multicolumn{2}{c}{Prior-Year} \\
			& \multicolumn{2}{c}{Sample} & \multicolumn{2}{c}{Insured} & \multicolumn{2}{c}{Uninsured}  \\  
			\cmidrule(lr){2-3} \cmidrule(lr){4-5} \cmidrule(lr){6-7} 
			& \multicolumn{1}{c}{Months of} & \multicolumn{1}{c}{Any}  & \multicolumn{1}{c}{Months of} & \multicolumn{1}{c}{Any} & \multicolumn{1}{c}{Months of} & \multicolumn{1}{c}{Any} \\
			& \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Coverage} \\ 

			\midrule
			\multicolumn{7}{c}{Panel A: All Ages} \\ 
			\midrule)
	postfoot(\midrule);

esttab c8 c7 c10 c9 c12 c11 using "$output/Coverage Effect by Past Year Coverage - Randomization Blocks.tex", append
	b(3) se(3) transform(@*100 100, pattern(0 1 0 1 0 1)) 
	nostar booktabs nogaps label noobs eqlabels(none) nonumbers nomtitles nodepvars collabels(none) mgroups(none)
	keep(treatment)  varl(treatment "Treated")  
	stats (ymean N, fmt(3 %15.0fc) label("Control mean" "Observations"))  
	prehead(\multicolumn{7}{c}{Panel B: Middle Age Adults} \\ 
			\midrule)
	postfoot(\midrule                  
			\multicolumn{7}{p{6.5in}}{\footnotesize{\emph{Notes:} The table reports the effect of the intervention on health insurance coverage enrollment from specifications that control for the randomization strata 
			used to assign tax returns to treatment groups. Apart from the presence of controls, the reported analyses correspond to those reported in Table [tab:Cov-Effect-Past-Year-Coverage]. The randomization
			strata were defined based on age and gender of primary filer, marital status, number of dependents, income, the presence of self-employment income, 2014 penalty status, and whether the taxpayer's 
			state expanded Medicaid and/or participated in the federal marketplace during 2017. All tax return data used in the construction of the randomization strata were derived from the 2015 tax return, 
			unless otherwise specified. All specifications omit randomization strata that contain a single individual after imposing the specified restriction.}}        
			\end{tabular}
			\end{table});
#delimit cr




/* ======================================
Table A.VII: Effect of Intervention on Likelihood of Enrolling in Any Coverage by Coverage Type
 =========================================*/

estimates clear
eststo clear
forval c = 1/12 {
	estimates use "$path/Estimates/type_of_coverage_051620.ster", number(`c')
	eststo c`c'
}

#delimit ;
esttab c2 c4 c6 c8 c10 c12 using "$output/Coverage Effect (Extensive) by Type of Coverage.tex", replace
	nogaps label noobs eqlabels(none)  nonumbers nomtitles 
	b(3) se(3) transform(@*100 100) 
	nostar
	keep(treatment)  varl(treatment "Treated")  
	stats (ymean N, fmt(3 %15.0fc) label("Control mean" "Observations"))
	prehead(\begin{table}[htbp]\centering
			\caption{Effect of Intervention on Likelihood of Enrolling in Any Coverage by Coverage Type}
			\begin{tabular}{l*{6}{c}}
			\toprule
			& \multicolumn{1}{c}{(1)}          & \multicolumn{1}{c}{(2)}      & \multicolumn{1}{c}{(3)} & \multicolumn{1}{c}{(4)}  & \multicolumn{1}{c}{(5)} & \multicolumn{1}{c}{(6)} \\ \cmidrule(lr){2-7}     
			& \multicolumn{1}{c}{Exchange} & \multicolumn{1}{c}{Medicaid} & \multicolumn{1}{c}{ESI} & \multicolumn{1}{c}{Off-Exchange}  & \multicolumn{1}{c}{VA} & \multicolumn{1}{c}{Medicare} \\
			\midrule
			\multicolumn{7}{c}{Panel A: All Ages} \\ 
			\midrule) 
	postfoot(\midrule);
#delimit cr	 

estimates clear
eststo clear
forval c = 1/12 {
	estimates use "$path/Estimates/type_of_coverage_4564_051620.ster", number(`c')
	eststo c`c'
}

#delimit ;
esttab c2 c4 c6 c8 c10 c12 using "$output/Coverage Effect (Extensive) by Type of Coverage.tex", append
	nogaps label noobs eqlabels(none)  nonumbers nomtitles 
	b(3) se(3) transform(@*100 100) 
	nostar
	keep(treatment)  varl(treatment "Treated")  
	stats (ymean N, fmt(3 %15.0fc) label("Control mean" "Observations"))
	prehead(\multicolumn{7}{c}{Panel B: Middle Age Adults} \\ 
			\midrule)
	postfoot(\midrule 		
			\multicolumn{7}{p{6.5in}}{\footnotesize{\emph{Notes:} The table reports the effect of the intervention on the likelihood of enrolling in one month or more of the specified form of coverage during 2017-18.
			Apart from the definition of the outcome variable, the reported analyses correspond to those in Table _. }}        
			\end{tabular}
			\end{table}) ;
#delimit cr	 




/* ================
Table A.VIII: Coverage Effect by Income and Medicaid Expansion State
===================*/

local semicolon = ";"

estimates clear
eststo clear
forval c = 1/6 {
	estimates use "$path/Estimates/cov_effect_fpl_exp_060420.ster", number(`c')
	eststo c`c'
}

#delimit ;
esttab c1 c2 c3 c4 c5 c6 using "$output/Coverage Effect by Income and Expansion state.tex", replace 
	nogaps label noobs eqlabels(none) collabel(none) nonumber nomtitles  
	b(3) se(3) 
	nostar 
	keep(treatment)  varl(treatment "Treated")  
	stats (ymean N, fmt(3 %15.0fc) label("Control mean" "Observations"))
	prehead(\begin{table}[htbp]
			\centering
			\caption{Coverage Effect by Income and Medicaid Expansion State}
			\begin{tabular}{l*{6}{c}}
			\toprule
			& \multicolumn{1}{c}{(1)}          & \multicolumn{1}{c}{(2)}      & \multicolumn{1}{c}{(3)} & \multicolumn{1}{c}{(4)}  & \multicolumn{1}{c}{(5)} & \multicolumn{1}{c}{(6)} \\ \cmidrule(lr){2-7}     
			& \multicolumn{2}{c}{All States} & \multicolumn{2}{c}{Expansion States}  & \multicolumn{2}{c}{Non-Expansion States} \\
			\cmidrule(lr){2-3} \cmidrule(lr){4-5} \cmidrule(lr){6-7} 
			& \multicolumn{1}{c}{FPL $\leq$ 138} & \multicolumn{1}{c}{FPL $>$ 138} & \multicolumn{1}{c}{FPL $\leq$ 138} & \multicolumn{1}{c}{FPL $>$ 138} & \multicolumn{1}{c}{FPL $\leq$ 138} & \multicolumn{1}{c}{FPL $>$ 138} \\
			\midrule
			\multicolumn{7}{c}{Panel A: All Ages} \\ 
			\midrule)  
	postfoot(\midrule) ;
#delimit cr	

estimates clear
eststo clear
forval c = 1/6 {
	estimates use "$path/Estimates/cov_effect45_64_fpl_exp_060420.ster", number(`c')
	eststo c`c'
}

#delimit ;
esttab c1 c2 c3 c4 c5 c6 using "$output/Coverage Effect by Income and Expansion state.tex", append 
	nogaps label noobs eqlabels(none) collabel(none) nonumber nomtitles  
	b(3) se(3) 
	nostar 
	keep(treatment)  varl(treatment "Treated")  
	stats (ymean N, fmt(3 %15.0fc) label("Control mean" "Observations"))
	prehead(\multicolumn{7}{c}{Panel B: Middle Age Adults} \\ 
			\midrule)  
	postfoot(\midrule 		
			\multicolumn{7}{p{6.5in}}{\footnotesize{\emph{Notes:} The table reports the effect of the intervention on coverage by household income and Medicaid expansion state status. The outcome is the number of months of
			coverage enrolled in during 2017-18.  Columns 1, 3, and 5 limit the analysis to individuals with 2015 household income less than or equal to 138\% of the applicable Federal Poverty Line, which corresponds to the
			threshold for Medicaid eligibility in Medicaid expansion states. Columns 2, 4, and 6 limit the analysis to individuals with 2015 household income in excess of that threshold. Columns 3 and 4 limit the sample to 
			individuals who in 2015 resided in states that expanded Medicaid under the Affordable Care Act`semicolon' columns 5 and 6 limit the sample to individuals who in 2015 resided in states that had not. Medicaid expansion state
			status is measured as of 2017. Panel B limits the analysis to individuals between the ages of 45 and 64 at the end of 2017. All columns exclude individuals with full coverage in January through November of 2016.
			Standard errors, reported in parentheses, are clustered by household. }}        
			\end{tabular}
			\end{table}) ;
#delimit cr	


/* ================
Table A.IX: Effect of Intervention on Medicaid Enrollment by Income and Expansion State
===================*/

local semicolon = ";"


estimates clear
eststo clear
forval c = 1/12 {
	estimates use "$path/Estimates/medicaid_fpl_exp_052720.ster", number(`c')
	eststo c`c'
}

#delimit ;
esttab c1 c2 c3 c4 c5 c6 using "$output/Medicaid Effect by Income and Expansion state.tex", replace 
	nogaps label noobs eqlabels(none) collabel(none) nonumber nomtitles  
	b(3) se(3) 
	nostar 
	keep(treatment)  varl(treatment "Treated")  
	stats (ymean N, fmt(3 %15.0fc) label("Control mean" "Observations"))
	prehead(\begin{table}[htbp]\centering
			\caption{Effect of Intervention on Medicaid Enrollment by Income and Expansion State}
			\begin{tabular}{l*{6}{c}}
			\toprule
			& \multicolumn{1}{c}{(1)}          & \multicolumn{1}{c}{(2)}      & \multicolumn{1}{c}{(3)} & \multicolumn{1}{c}{(4)}  & \multicolumn{1}{c}{(5)} & \multicolumn{1}{c}{(6)} \\ \cmidrule(lr){2-7}     
			& \multicolumn{2}{c}{All States} & \multicolumn{2}{c}{Expansion States}  & \multicolumn{2}{c}{Non-Expansion States} \\
			\cmidrule(lr){2-3} \cmidrule(lr){4-5} \cmidrule(lr){6-7} 
			& \multicolumn{1}{c}{FPL $\leq$ 138} & \multicolumn{1}{c}{FPL $>$ 138} & \multicolumn{1}{c}{FPL $\leq$ 138} & \multicolumn{1}{c}{FPL $>$ 138} & \multicolumn{1}{c}{FPL $\leq$ 138} & \multicolumn{1}{c}{FPL $>$ 138} \\
			\midrule
			\multicolumn{7}{c}{Panel A: All Ages} \\ 
			\midrule)  
	postfoot(\midrule) ;

esttab c7 c8 c9 c10 c11 c12 using "$output/Medicaid Effect by Income and Expansion state.tex", append 
	nogaps label noobs eqlabels(none) collabel(none) nonumber nomtitles  
	b(3) se(3) 
	nostar 
	keep(treatment)  varl(treatment "Treated")  
	stats (ymean N, fmt(3 %15.0fc) label("Control mean" "Observations"))
	prehead(\multicolumn{7}{c}{Panel B: Middle Age Adults} \\ 
			\midrule)  
	postfoot(\midrule 		
			\multicolumn{7}{p{6.5in}}{\footnotesize{\emph{Notes:} The table reports the effect of the intervention on Medicaid coverage by household income and Medicaid expansion state status. The outcome is the number of months
			of Medicaid coverage enrolled in during 2017-18.  Columns 1, 3, and 5 limit the analysis to individuals with 2015 household income less than or equal to 138\% of the applicable Federal Poverty Line,
			which corresponds to the threshold for Medicaid eligibility in Medicaid expansion states. Columns 2, 4, and 6 limit the analysis to individuals with 2015 household income in excess of that threshold.
			Columns 3 and 4 limit the sample to individuals who in 2015 resided in states that expanded Medicaid under the Affordable Care Act`semicolon' columns 5 and 6 limit the sample to individuals who in 2015
			resided in states that had not. Medicaid expansion state status is measured as of 2017. Panel B limits the analysis to individuals between the ages of 45 and 64 at the end of 2017. All columns exclude
			individuals with full coverage in January through November of 2016. Standard errors, reported in parentheses, are clustered by household. }}        
			\end{tabular}
			\end{table}) ;
#delimit cr	


/* ================
Table A.X: Effect of Intervention on Non-Medicaid Enrollment by Income and Expansion State
===================*/

local semicolon = ";"

estimates clear
eststo clear
forval c = 1/12 {
	estimates use "$path/Estimates/non_medicaid_fpl_exp_052720.ster", number(`c')
	eststo c`c'
}

#delimit ;
esttab c1 c2 c3 c4 c5 c6 using "$output/Non-Medicaid Effect by Income and Expansion state.tex", replace 
	nogaps label noobs eqlabels(none) collabel(none) nonumber nomtitles  
	b(3) se(3) 
	nostar 
	keep(treatment)  varl(treatment "Treated")  
	stats (ymean N, fmt(3 %15.0fc) label("Control mean" "Observations"))
	prehead(\begin{table}[htbp]\centering
			\caption{Effect of Intervention on Non-Medicaid Enrollment by Income and Expansion State}
			\begin{tabular}{l*{6}{c}}
			\toprule
			& \multicolumn{1}{c}{(1)}          & \multicolumn{1}{c}{(2)}      & \multicolumn{1}{c}{(3)} & \multicolumn{1}{c}{(4)}  & \multicolumn{1}{c}{(5)} & \multicolumn{1}{c}{(6)} \\ \cmidrule(lr){2-7}     
			& \multicolumn{2}{c}{All States} & \multicolumn{2}{c}{Expansion States}  & \multicolumn{2}{c}{Non-Expansion States} \\
			\cmidrule(lr){2-3} \cmidrule(lr){4-5} \cmidrule(lr){6-7} 
			& \multicolumn{1}{c}{FPL $\leq$ 138} & \multicolumn{1}{c}{FPL $>$ 138} & \multicolumn{1}{c}{FPL $\leq$ 138} & \multicolumn{1}{c}{FPL $>$ 138} & \multicolumn{1}{c}{FPL $\leq$ 138} & \multicolumn{1}{c}{FPL $>$ 138} \\
			\midrule
			\multicolumn{7}{c}{Panel A: All Ages} \\ 
			\midrule)  
	postfoot(\midrule) ;

esttab c7 c8 c9 c10 c11 c12 using "$output/Non-Medicaid Effect by Income and Expansion state.tex", append 
	nogaps label noobs eqlabels(none) collabel(none) nonumber nomtitles  
	b(3) se(3) 
	nostar 
	keep(treatment)  varl(treatment "Treated")  
	stats (ymean N, fmt(3 %15.0fc) label("Control mean" "Observations"))
	prehead(\multicolumn{7}{c}{Panel B: Middle Age Adults} \\ 
			\midrule)  
	postfoot(\midrule 		
			\multicolumn{7}{p{6.5in}}{\footnotesize{\emph{Notes:} The table reports the effect of the intervention on non-Medicaid coverage by household income and Medicaid expansion state status. The outcome is the number
			of months of all forms of coverage enrolled in during 2017-18 that were not Medicaid. Columns 1, 3, and 5 limit the analysis to individuals with 2015 household income less than or equal to 138\% of the applicable
			Federal Poverty Line, which corresponds to the threshold for Medicaid eligibility in Medicaid expansion states. Columns 2, 4, and 6 limit the analysis to individuals with 2015 household income in excess of that
			threshold. Columns 3 and 4 limit the sample to individuals who in 2015 resided in states that expanded Medicaid under the Affordable Care Act`semicolon' columns 5 and 6 limit the sample to individuals who in 2015
			resided in states that had not. Medicaid expansion state status is measured as of 2017. Panel B limits the analysis to individuals between the ages of 45 and 64 at the end of 2017. All columns exclude individuals
			with full coverage in January through November of 2016. Standard errors, reported in parentheses, are clustered by household. }}        
			\end{tabular}
			\end{table}) ;
#delimit cr	




/* ====================
Table A.XI: Coverage Effect Heterogeneity
=======================*/

local semicolon = ";"

estimates clear
eststo clear

forval c = 1/8 {
	estimates use "$path/Estimates/cov_hetgen_1_051620.ster", number(`c')
	eststo c`c'
}

#delimit ;
esttab c1 c2 c3 c4 c5 c6 c7 c8 using "$output/Heterogeneity in Coverage Effect.tex", replace 
	nogaps label noobs eqlabels(none) collabel(none) nonumber nomtitles  
	b(3) se(3) 
	nostar 
	keep(treatment)  varl(treatment "Treated")  
	stats (ymean N, fmt(3 %15.0fc) label("Control mean" "Observations"))
	prehead(\begin{table}[htbp]
			\caption{Coverage Effect Heterogeneity}
			\makebox[\textwidth][c]{  
			\centering
			\begin{tabular}{l*{8}{c}}                       
			\toprule            
			& \multicolumn{1}{c}{(1)} & \multicolumn{1}{c}{(2)} & \multicolumn{1}{c}{(3)} & \multicolumn{1}{c}{(4)}  & \multicolumn{1}{c}{(5)} & \multicolumn{1}{c}{(6)} & \multicolumn{1}{c}{(7)} & \multicolumn{1}{c}{(8)} \\ \cmidrule(lr){2-9}        
			& \multicolumn{1}{c}{Men} & \multicolumn{1}{c}{Women} & \multicolumn{1}{c}{Married} &\multicolumn{1}{c}{Unmarried} & \multicolumn{1}{c}{Self-Prepared} & \multicolumn{1}{c}{Professionally} & \multicolumn{1}{c}{Successful} & \multicolumn{1}{c}{Challenges} \\                         
			& \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{}  & \multicolumn{1}{c}{Returns} & \multicolumn{1}{c}{Prepared} & \multicolumn{1}{c}{Exchange} & \multicolumn{1}{c}{with Exchange}  \\
			& \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{}  & \multicolumn{1}{c}{} & \multicolumn{1}{c}{Returns} & \multicolumn{1}{c}{Rollout} & \multicolumn{1}{c}{Rollout}  \\
			\midrule
			\multicolumn{9}{c}{Panel A: All Ages} \\            
			\midrule)  
	postfoot(\midrule) ;
#delimit cr	

estimates clear
eststo clear
forval c = 1/8{
	estimates use "$path/Estimates/cov_hetgen_45_64_1_051620.ster", number(`c')
	eststo c`c'
}

#delimit ;
esttab c1 c2 c3 c4 c5 c6 c7 c8 using "$output/Heterogeneity in Coverage Effect.tex", append 
	nogaps label noobs eqlabels(none) collabel(none) nonumber nomtitles  
	b(3) se(3) 
	nostar 
	keep(treatment)  varl(treatment "Treated")  
	stats (ymean N, fmt(3 %15.0fc) label("Control mean" "Observations"))
	prehead(\multicolumn{9}{c}{Panel B: Middle Age Adults} \\ 
			\midrule)  
	postfoot(\midrule 		
			\multicolumn{9}{p{8in}}{\footnotesize{\emph{Notes:} The table reports heterogeneity in the effect of the intervention on coverage across the specified dimensions. The outcome is the number of months of
			coverage enrolled in during 2017-18. Marital status and return preparation method are measured from the 2015 tax return. Successful exchange rollout refers to states that did not experience major technical problems
			during the rollout of their health insurance marketplace`semicolon' challenges with exchange rollout refers to states that did experience such problems. The latter category includes all states that adopted the federal
			marketplace. Panel B limits the analysis to individuals between the ages of 45 and 64 at the end of 2017. All columns exclude individuals with full coverage in January through November of 2016. Standard errors,
			reported in parentheses, are clustered by household.}}       
			\end{tabular}}
			\end{table}) ;

#delimit cr	


/* ====================================================
Table A.XII: Coverage Effect Heterogeneity - Combined Model
=======================================================*/

estimates clear
eststo clear 

forval c = 1/4{

estimates use "$path/Estimates/cov_hetgen_2_061820.ster", number(`c')
eststo c`c'

}

local semicolon = ";"

* .tex
#delimit ;

esttab c1 c3 c2 c4 using "$output/Heterogeneity in Coverage Effect - Combined.tex", replace 
	nogaps label noobs eqlabels(none) collabel(none) nonumber nomtitles  
	b(3) se(3) nocons nostar transform(@*100 100, pattern(0 1 0 1)) 
	order(treatment  male_t married_t income_t expansion_t no_botched_rollout_t self_prepared_t age_45_t 					
			male married income expansion no_botched_rollout self_prepared age_45)
	varlabel(treatment "Treatment"
			 male "Male"
			 married "Married"
			 income "Income/FPL \% $\leq$ 138"
			 expansion "Expansion State"
			 age_45 "Age $\geq$ 45"
			 no_botched_rollout "Successful Rollout"
			 self_prepared "Self-Prepared Returns"
			 male_t "Treatment $\times$ Male"
			 married_t "Treatment $\times$ Married"
			 income_t "Treatment $\times$ Income/FPL \% $\leq$ 138 "
			 expansion_t "Treatment $\times$ Expansion State"
			 age_45_t "Treatment $\times$ Age $\geq$ 45"
			 no_botched_rollout_t "Treatment $\times$ Successful Rollout"
			 self_prepared_t "Treatment $\times$ Self-Prepared Returns")  
	stats(ymean N, fmt(3 %15.0fc) label("Control Mean" "Observations"))
	prehead(\begin{table}[htbp]\centering
			\caption{Coverage Effect Heterogeneity - Combined Model} 
			\begin{tabular}{l*{4}{c}}
			\toprule
			& \multicolumn{1}{c}{(1)} &  \multicolumn{1}{c}{(2)} &  \multicolumn{1}{c}{(3)}  &  \multicolumn{1}{c}{(4)} \\ \cmidrule(lr){2-5} 
			& \multicolumn{2}{c}{All Ages}  & \multicolumn{2}{c}{Ages 45-64} \\          
			\cmidrule(lr){2-3} \cmidrule(lr){4-5} 
			& \multicolumn{1}{c}{Months of} & \multicolumn{1}{c}{Any} & \multicolumn{1}{c}{Months of} & \multicolumn{1}{c}{Any} \\  
			& \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Coverage} \\
			\midrule)
	postfoot(\midrule
			\multicolumn{5}{p{6in}}{\footnotesize{\emph{Notes:} The table reports heterogeneity in the effect of the intervention on coverage across the specified dimensions. In columns 1 and 3,
			the outcome is the number of months of coverage enrolled in during 2017-18. In columns 2 and 4, the outcome indicates enrollment in one or more month of coverage during 2017-18`semicolon'
			units are percentage points (0-100). Columns 3 and 4 limit the analysis to individuals between the ages of 45 and 64 at the end of 2017. Marital status and return preparation method are
			measured from the 2015 tax return. Successful exchange rollout refers to states that did not experience major technical problems during the rollout of their health insurance marketplace`semicolon'
			challenges with exchange rollout refers to states that did experience such problems. The latter category includes all states that adopted the federal marketplace. All columns exclude
			individuals with full coverage in January through November of 2016. Standard errors, reported in parentheses, are clustered by household.}}
			\end{tabular}                                                
			\end{table});	

#delimit cr	


/* ================================
Table A.XIII: Coverage Effect by Treatment Arm
 ===================================*/
estimates clear
eststo clear 

forval c = 1/4 {
	estimates use "$path/Estimates/treatment_arms_060820.ster", number(`c')
	eststo c`c'
}

local semicolon= ";"


#delimit ;
esttab c1 c2 c3 c4 using "$output/Coverage Effect by Treatment Arms.tex", replace 
	b(3) se(3) transform(@*100 100, pattern(0 1 0 1)) 
	nostar booktabs nogaps label noobs eqlabels(none) nonumbers nomtitles nodepvars collabels(none) mgroups(none)
	keep(treatment early nonpersonalize exemption_info spanish)  
	order(treatment early nonpersonalize exemption_info spanish)
	varl(treatment "Treatment" nonpersonalize "Treatment $\times$ Non-Personalized"  
		early "Treatment $\times$ Early" exemption_info "Treatment $\times$  Exemption Info" 
		spanish "Treatment $\times$ Spanish" )  
	stats (ymean N, fmt(3 %15.0fc) label("Control mean" "Observations"))  
	prehead(\begin{table}[htbp]                     
			\caption{Coverage Effect by Treatment Arm}                                                
			\centering                                                 
			\begin{tabular}{l*{4}{c}}           
			\toprule                                
			& \multicolumn{1}{c}{(1)} &  \multicolumn{1}{c}{(2)} & \multicolumn{1}{c}{(3)} & \multicolumn{1}{c}{(4)}  \\                    
			\cmidrule(lr){2-5}                              
			& \multicolumn{2}{c}{All Ages}  & \multicolumn{2}{c}{Ages 45-64} \\          
			\cmidrule(lr){2-3} \cmidrule(lr){4-5}     
			& \multicolumn{1}{c}{Months of} & \multicolumn{1}{c}{Any} & \multicolumn{1}{c}{Months of} & \multicolumn{1}{c}{Any} \\
			& \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Coverage} \\
			\midrule)
	postfoot(\midrule          
			\multicolumn{5}{p{5.75in}}{\footnotesize{\emph{Notes:} The table reports the effect of the intervention on coverage based on which treatment arm a taxpayer was assigned. The base treatment contained a personalized
			estimate of the 2017 household penalty for lacking coverage, was sent during the mid-January mailing, and did not include information about applying for an exemption. Treatment $\times$ Early indicates being sent
			a letter during the late-November mailing. Treatment $\times$ Non-Personalized indicates being sent a letter without a personalized 2017 penalty estimate. Treatment $\times$ Exemption Info indicates being sent a letter with
			information about applying for an exemption from the penalty. Treatment $\times$ Spanish indicates that the letter included a Spanish language translation. Sample letters, corresponding to the different treatment arms,
			are contained in Appendix Figure _. In columns 1 and 3, the outcome is months of coverage during 2017-18. In columns 2 and 4, the outcome indicates enrollment in one or more month of coverage during 2017-18`semicolon' 
			units are percentage points (0-100). Columns 3 and 4 limit the analysis to individuals between the ages of 45 and 64 at the end of 2017. All columns exclude individuals with full coverage in January through
			November of 2016. Standard errors, reported in parentheses, are clustered by household.}}
			\end{tabular}                                         
			\end{table}) ;
#delimit cr


/* =================================================
Table A.XIV: Summary Statistics for Previously Uninsured and Middle Age Samples
==================================================*/

estimates clear
estimates use "$path/Estimates/sum_stats_full_sample_081120.ster"
mat full_sample = e(mu)  
estimates use "$path/Estimates/sum_stats_notall16_081120.ster"
mat notall16 = e(mu)  
estimates use "$path/Estimates/sum_stats_age45_64_081120.ster"
mat age45_64 = e(mu)  

estadd matrix full_sample = full_sample
estadd matrix notall16 = notall16
estadd matrix age45_64 = age45_64

local semicolon = ";"

#delimit ;
global mean_format "%10.3fc %10.1fc %10.3fc %10.3fc %10.3fc %10.3fc %10.3fc
					%10.3fc %10.0fc  %10.3fc %10.2fc %10.3fc 
					%10.3fc %10.3fc %10.3fc %10.3fc 
					%10.3fc %10.3fc %10.0fc %10.3fc %10.3fc %10.0fc %10.0fc
					%10.3fc %10.2fc %10.3fc 
					%10.3fc %10.2fc %10.3fc 
					%10.0fc %10.0fc" ;

esttab using "$output/Summary Statistics - Restricted Sample.tex", replace
	booktabs nogaps label noobs collabels(none) nonumber eqlabels(none) nomtitles 
	cells("full_sample (fmt($mean_format)) notall16 (fmt($mean_format)) age45_64 (fmt($mean_format))") 
	prehead(\begin{table}[htbp]             
			\footnotesize          
			\caption{Summary Statistics for Previously Uninsured and Middle Age Samples}      
			\makebox[\textwidth][c]{
			\centering                                      
			\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}                        
			\begin{tabular}{l*{1}{ccc}}                     
			\toprule
			&\multicolumn{1}{c}{(1)}        & \multicolumn{1}{c}{(2)}   & \multicolumn{1}{c}{(3)}  \\                            
			\cmidrule(lr){2-4}
			& \multicolumn{1}{c}{Experimental} & \multicolumn{2}{c}{Prior-Year Uninsured} \\ \cmidrule(lr){3-4}               
			& \multicolumn{1}{c}{Sample} & \multicolumn{1}{c}{All Ages}  & \multicolumn{1}{c}{Ages 45-64} \\                 
			\midrule) 
	varl(female 		  "\hspace{0.2cm} Female"
		 age_2017 		  "\hspace{0.2cm} Age"
		 age0_18 		  "\hspace{0.6cm} 0 - 18"
		 age19_26 		  "\hspace{0.6cm} 19 - 26"
		 age27_44		  "\hspace{0.6cm} 27 - 45"
		 age45_64 		  "\hspace{0.6cm} 45 - 64"
		 age65plus 	  	  "\hspace{0.6cm} 65 or older \vspace{0.2 cm}"
		 
		 married 		  "\hspace{0.2cm} Married"
		 income 		  "\hspace{0.2cm} Household income"
		 fpl_frac138	  "\hspace{0.2cm} Income $<$ 138\% FPL"
		 tot_exmpt 	  	  "\hspace{0.2cm} Household size"
		 self_prepared	  "\hspace{0.2cm} Self-Prepared Returns  \vspace{0.2 cm}"	

		 hsorhigher 	  "\hspace{0.2cm} High school degree or higher"
		 baorhigher 	  "\hspace{0.2cm} BA degree or higher "
		 expansion  	  "\hspace{0.2cm} Expansion state"
		 SBM 		 	  "\hspace{0.2cm} State-based marketplace \vspace{0.2 cm}"
		
		 exempt2014       "\hspace{0.2cm} Claimed 2014 exemption"
		 penalty_2014d    "\hspace{0.2cm} Paid 2014 penalty"
		 penalty_2014     "\hspace{0.2cm} 2014 penalty if penalized"
		 exempt2015       "\hspace{0.2cm} Claimed 2015 exemption"
		 penalty_2015d    "\hspace{0.2cm} Paid 2015 penalty"
		 penalty_2015     "\hspace{0.2cm} 2015 penalty if penalized"
		 penalty 		  "\hspace{0.2cm} Projected 2017 annualized penalty \vspace{0.2 cm}"

		 any_covered2015  "\hspace{0.2cm} Any coverage"
		 covered2015 	  "\hspace{0.2cm} Covered months"
		 full_year_2015   "\hspace{0.2cm} Full-year coverage \vspace{0.2 cm}"

		 any_covered2016_first11  "\hspace{0.2cm} Any coverage"
		 covered2016_first11 	  "\hspace{0.2cm} Covered months"
		 full_2016_first11	      "\hspace{0.2cm} Full-year coverage \vspace{0.2 cm}"
		 
		 ind_count 	  	  "\hspace{0.2cm} Individuals"
		 hh_count  	      "\hspace{0.2cm} Households")
	refcat(female "\emph{Individual characteristics}"
		   married "\emph{Household characteristics}" 
		   hsorhigher "\emph{Local characteristics}" 
		   exempt2014 "\emph{Penalty}" 
		   any_covered2015 "\emph{2015 coverage (Jan-Dec)}" 
		   any_covered2016_first11 "\emph{2016 coverage (Jan-Nov)}" 
		   ind_count "\emph{Observations}", nolabel) 
	postfoot(\midrule    
			\multicolumn{4}{p{5.25in}}{\footnotesize{\emph{Notes}: The table contains summary statistics for the overall experimental sample (column 1) and individuals that were not enrolled in coverage in one or more of the first
			11 months of 2016 (columns 2 and 3). Column 3 is limited to individuals between the ages of 45 and 64 at the end of 2017. All statistics are calculated at the individual level. Age refers to the individual's age at the
			end of 2015. Local characteristics are imputed based on the zip code corresponding to the individual's 2015 tax return. Households correspond to the individuals listed on a tax return.}}
			\end{tabular}                                            
			}
			\end{table}) ;
#delimit cr 

/* ================================
Table A.XV: Effect of Intervention on Mortality - Alternative Age Cutoffs
===================================*/

estimates clear
eststo clear 

foreach c of numlist 1/6{
estimates use "$path/Estimates/mortality_age_cutoffs_052020.ster", number(`c')
estadd scalar p_val = (2 * ttail(e(df_r), abs(_b[treatment]/_se[treatment])))
eststo c`c'
}

#delimit ;
esttab c1 c2 c3 c4 c5 c6 using "$output/Moratlity - Age Cutoffs.tex", replace 
	nogaps label noobs eqlabels(none) collabel(none) nonumber nomtitles  
	b(3) se(3) transform(@*100 100) 
	nostar
	keep(treatment) 
	varlabel(treatment "Treated")  
	stats(p_val ymean N, fmt(3 3 %15.0fc) label("p-value" "Control Mean" "Observations"))
	prehead(\begin{table}[htbp]\centering
			\caption{Effect of Intervention on Mortality - Alternative Age Cutoffs}   
  			\begin{tabular}{l*{6}{c}}
			\toprule
			& \multicolumn{1}{c}{(1)} &  \multicolumn{1}{c}{(2)} &  \multicolumn{1}{c}{(3)}  &  \multicolumn{1}{c}{(4)} &  \multicolumn{1}{c}{(5)} &  \multicolumn{1}{c}{(6)} \\ \cmidrule(lr){2-7} 
			& \multicolumn{1}{c}{35-64} & \multicolumn{1}{c}{40-64} & \multicolumn{1}{c}{45-64} & \multicolumn{1}{c}{50-64} & \multicolumn{1}{c}{55-64} & \multicolumn{1}{c}{All Ages} \\   
			& \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{(Main Sample)}  & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} \\
			\midrule)
	postfoot(\midrule                       
			\multicolumn{7}{p{6.75in}}{\footnotesize{\emph{Notes:} The table reports the effect of the intervention on mortality using alternative age thresholds for which individuals to include in the
			analysis. Columns indicate the ages of the taxpayers included in the analysis. Age is measured as of the end of 2017. In all columns, the outcome indicates mortality during 2017-18. Units
			are percentage points (0-100). The reported p-value corresponds to the null hypothesis that the effect of the intervention on mortality is zero. All columns exclude individuals with full
			coverage in January through November of 2016. Standard errors, reported in parentheses, are clustered by household. }}
			\end{tabular}                 
			\end{table});
#delimit cr	



/* ====================================================
Table A.XVI: Effect of Intervention on Middle Age Mortality - No Exclusion for Prior-Year Insured
=======================================================*/

estimates clear
eststo clear 

estimates use "$path/Estimates/mort_no16exclusion_052020.ster", number(1)
estadd scalar p_val = (2 * ttail(e(df_r), abs(_b[treatment]/_se[treatment])))
eststo c1


* .tex
#delimit ;
esttab c1 using "$output/Mortality - No-Prior Year Exclusion.tex", replace 
	nogaps label noobs eqlabels(none) collabel(none) nonumber nomtitles  
	b(3) se(3) transform(@*100 100) 
	nostar
	keep(treatment) 
	varlabel(treatment "Treated")  
	stats(p_val ymean N, fmt(3 3 %15.0fc) label("p-value" "Control Mean" "Observations"))
	prehead(\begin{table}[htbp]\centering
			\caption{Effect of Intervention on Middle Age Mortality - No Exclusion for Prior-Year Insured}
			\begin{tabular}{l*{2}{c}}  
			\toprule
			& \multicolumn{1}{c}{Mortality}  \\ 
			\midrule)
	postfoot(\midrule
			\multicolumn{2}{p{3in}}{\footnotesize{\emph{Notes}: The table reports the effect of the intervention on mortality without excluding individuals that had coverage during each of the first 11 months of 2016. The
			outcome indicates mortality during 2017-18. Units are percentage points (0-100). The reported p-value corresponds to the null hypothesis that the effect of the intervention on mortality is zero. The analysis
			includes individuals with and without full coverage in January through November of 2016. Standard errors, reported in parentheses, are clustered by household.}}
			\end{tabular}                                                
			\end{table});	
#delimit cr	



/* ====================================================
Table A.XVII: Effect of Intervention on Middle Age Mortality: Alternate Specifications
  =======================================================*/

estimates clear
eststo clear

estimates use "$path/Estimates/mort_nonlinear_062220", number(1)
local reduced_b_1 = _b[treatment]*100
local reduced_se_1 = _se[treatment]*100
local p_value_reduced_1 = (2 * ttail( e(N_clust), abs(_b[treatment]/_se[treatment])))
local obs_reduced_1 = e(N)

estimates use "$path/Estimates/mort_nonlinear_052620", number(1)
local reduced_b_2 = _b[treatment]*100
local reduced_se_2 = _se[treatment]*100
local p_value_reduced_2 = (2 * ttail( e(N_clust), abs(_b[treatment]/_se[treatment])))
local obs_reduced_2 = e(N)

estimates use "$path/Estimates/mort_nonlinear_052620", number(2)
local logit_b_1 = _b[1.treatment]*100
local logit_se_1 = _se[1.treatment]*100
local p_value_1 = e(pval)
local obs_1 = e(N)
local controls_1 = "."

estimates use "$path/Estimates/mort_nonlinear_052620", number(3)
nlcom marginal_effect_1: _b[1.treatment] - _b[0.treatment], post
local me_b_1 = _b[marginal_effect_1]*100
local me_se_1 = _se[marginal_effect_1]*100

estimates use "$path/Estimates/mort_nonlinear_062220", number(2)
local logit_b_2 = _b[1.treatment]*100
local logit_se_2 = _se[1.treatment]*100
local p_value_2 =  e(pval)
local obs_2 = e(N)
local controls_2 = "$\times$"

estimates use "$path/Estimates/mort_nonlinear_062220", number(3)
nlcom marginal_effect_2: _b[1.treatment] - _b[0.treatment], post
local me_b_2 = _b[marginal_effect]*100
local me_se_2 = _se[marginal_effect]*100

estimates use "$path/Estimates/mort_nonlinear_052620", number(4)
local cox_b_1 = _b[treatment]*100 
local cox_se_1 = _se[treatment]*100
local p_value_cox_1 = e(pval)
local obs_cox_1 = e(N)
local controls_cox_1 = "."

estimates use "$path/Estimates/mort_nonlinear_062220", number(4)
local cox_b_2 = _b[treatment]*100 
local cox_se_2 = _se[treatment]*100
local p_value_cox_2 = e(pval)
local obs_cox_2 = e(N)
local controls_cox_2 = "$times$"

estimates use "$path/Estimates/mort_nonlinear_052620", number(5)
mat logrank = e(results_logrank)
local p_value_logrank =  logrank[1,2]

estadd matrix r1 = [`reduced_b_1' , ., `p_value_reduced_1' , 123 , `obs_reduced_1'], replace
estadd matrix r2 = [`reduced_se_1'], replace

estadd matrix r3 = [`reduced_b_2' , ., `p_value_reduced_2' , 123, `obs_reduced_2'], replace
estadd matrix r4 = [`reduced_se_2'], replace

estadd matrix r5 = [`logit_b_1' , `me_b_1' , `p_value_1' , . , `obs_1'], replace
estadd matrix r6 = [`logit_se_1', `me_se_1'], replace

estadd matrix r7 = [`logit_b_2', `me_b_2', `p_value_2', 123, `obs_2' ], replace
estadd matrix r8 = [`logit_se_2', `me_se_2'], replace

estadd matrix r9 = [`cox_b_1', . , `p_value_cox_1', . , `obs_cox_1'], replace
estadd matrix r10 = [`cox_se_1'], replace

estadd matrix r11 = [`cox_b_2', . , `p_value_cox_2', 123,  `obs_cox_2'], replace
estadd matrix r12 = [`cox_se_2'], replace

estadd matrix r13 = [. , . , `p_value_logrank', . , `obs_cox_1'], replace

local format1 "%10.3fc  %10.3fc %10.3fc  %15.0fc"
local semicolon ";"

#delim ;
esttab using "$output/Mortality - Non-Linear.tex" , 
		cells("r1 (fmt(`format1')) r3 (fmt(`format1')) r5 (fmt(`format1')) r7 (fmt(`format1')) r9 (fmt(`format1')) r11 (fmt(`format1')) r13 (fmt(`format1'))"
			  "r2(fmt(3)par) r4(fmt(3)par) r6(fmt(3)par) r8(fmt(3)par) r10(fmt(3)par) r12(fmt(3)par) r14" ) noobs 
		prehead(\begin{table}[htbp]\centering                                 
				\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}                           
				\caption{Effect of Intervention on Middle Age Mortality: Alternate Specifications}
				\makebox[\textwidth][c]{
				\centering
				\begin{tabular}{l*{1}{ccccccc}}                                 
				\toprule              
				&\multicolumn{1}{c}{(1)} & \multicolumn{1}{c}{(2)} &  \multicolumn{1}{c}{(3)} & \multicolumn{1}{c}{(4)} & \multicolumn{1}{c}{(5)}  & \multicolumn{1}{c}{(6)} & \multicolumn{1}{c}{(7)} \\ 
				\cmidrule(lr){2-8}          
				& \multicolumn{1}{c}{LDV} & \multicolumn{1}{c}{LDV} &\multicolumn{1}{c}{Logit} & \multicolumn{1}{c}{Logit} & \multicolumn{1}{c}{Cox} & \multicolumn{1}{c}{Cox} & \multicolumn{1}{c}{Log-Rank} \\    
				&\multicolumn{1}{c}{(with Controls)} & \multicolumn{1}{c}{(with Controls)} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{Proportional-} & \multicolumn{1}{c}{Proportional-} & \multicolumn{1}{c}{Test} \\          
				& \multicolumn{1}{c}{} & \multicolumn{1}{c}{} &\multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{Hazard} & \multicolumn{1}{c}{Hazard} & \multicolumn{1}{c}{} \\    
				\midrule)
		collabels(none) nomtitles nonumber
		varl(c1 "Treated" 
			 c2 "Marginal Effect" 
			 c3 "p-value" 
			 c4 "\midrule Controls" 
			 c5 "Observations")			 
		nogaps replace
		postfoot(\midrule
		\multicolumn{8}{p{7.5in}}{\footnotesize{\emph{Notes:} The table reports the effect of the intervention on mortality under alternative specifications. In all columns, the outcome indicates mortality during 2017-18.
		Units are percentage points (0-100). Column 1 reports results from a linear dependent variable model that controls for the demographic and geographic covariates described in the notes to Appendix Table __.
		Column 2 reports results from a linear dependent variable model that controls for randomization strata indicators described in the notes to Appendix Table __.  Columns 3 and 4 report the results of a logit model,
		with and without the control variables included in Column 1. The reported marginal effect is calculated at covariate means. Columns 5 and 6 report the results of a Cox Proportional-Hazard model, analyzed at the month
		level, with and without the control variables included in Column 1. In Columns 1-6, the reported p-value corresponds to the null hypothesis that the treatment variable does not enter into the model. Column 7
		reports a log-rank test`semicolon' the p-value corresponds to the null hypothesis of equality between the survival curves for individuals in the treatment and control group. All columns exclude individuals with
		full coverage in January through November of 2016 and are limited to individuals between the ages of 45-64 at the end of 2017. Standard errors, reported in parentheses are clustered by household. }}                       
		\end{tabular}}
		\end{table}})
		substitute(.& & .\\ \\ 123& $\times$&);
#delim cr



/* ====================================================
Table A.XVIII: Indirect Budgetary Costs of the Intervention for Middle Age Taxpayers
=======================================================*/

clear all
mat drop _all

use "$path/Data/vsl_table_051420.dta", clear

gen PMC_2017 = costs_20171/costs_20172

gen PMC_2018 = costs_20181/costs_20182

gen cost_per_ind_2017 = PMC_2017*costs_20173
replace cost_per_ind_2017 = 0.545*cost_per_ind_2017*0.9 if _n == 2

gen cost_per_ind_2018 = PMC_2018*costs_20183
replace cost_per_ind_2018 = 0.545*cost_per_ind_2018*0.9 if _n == 2

rename costs_20173 int_effect_2017

rename costs_20183 int_effect_2018

keep PMC_2017 PMC_2018 cost_per_ind_2017 cost_per_ind_2018 int_effect_2017 int_effect_2018

replace cost_per_ind_2017 = 5.25 if _n == 3
replace PMC_2017  = . if _n == 3
replace int_effect_2017 = . if _n == 3

replace cost_per_ind_2018 = 4.16 if _n == 3
replace PMC_2018  = . if _n == 3
replace int_effect_2018 = . if _n == 3

replace cost_per_ind_2018 = 0 if _n == 2
replace int_effect_2018 = 0 if _n == 2


foreach i in PMC_2017 PMC_2018 cost_per_ind_2017 cost_per_ind_2018 int_effect_2017 int_effect_2018{
mkmat `i', matrix(`i')
}

mat rownames PMC_2018 = r6 r7 r8 r9 r10 
mat rownames int_effect_2018 = r6 r7 r8 r9 r10 
mat rownames cost_per_ind_2018 = r6 r7 r8 r9 r10 

gen total_cost_17_18 = cost_per_ind_2017 + cost_per_ind_2018
egen total = sum(total_cost_17_18)

summ total 

estadd mat c1 = [ PMC_2017 \ PMC_2018 \ . ]' 
estadd mat c2 = [ int_effect_2017 \ int_effect_2018 \ .]' 
estadd mat c3 = [cost_per_ind_2017 \cost_per_ind_2018 \ r(mean) ]'


local semicolon ";"


#delim ;
esttab using "$output/Budgetary Costs.tex", cells("c1(fmt(2)) c2(fmt(2)) c3(fmt(2))") noobs
		collabels(none) nomtitles replace nonumber 
		prehead(\begin{table}[htbp]\centering
				\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
				\caption{Indirect Budgetary Costs of the Intervention for Middle Age Taxpayers}
				\makebox[\textwidth][c]{
				\centering
				\begin{tabular}{l*{1}{ccc}}
				\toprule
				& \multicolumn{1}{c}{(1)} & \multicolumn{1}{c}{(2)} &  \multicolumn{1}{c}{(3)} \\ \cmidrule(lr){2-4}        
				& \multicolumn{1}{c}{Per-Month Cost} & \multicolumn{1}{c}{Intervention Effect} & \multicolumn{1}{c}{Contribution to} \\
				& \multicolumn{1}{c}{(\\$/Month)} & \multicolumn{1}{c}{(Months)} & \multicolumn{1}{c}{Costs Per Treated} \\
				& \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{Individual (\\$)} \\
				\midrule)
		varl(r1 "\hspace{0.3cm} Premium Tax Credit" 
			 r2 "\hspace{0.3cm} Cost-Sharing Reductions" 
			 r3 "\hspace{0.3cm} Individual Penalty" 
			 r4 "\hspace{0.3cm} Medicaid" 
			 r5 "\hspace{0.3cm} ESI Tax Exclusion" 
			 r6 "\hspace{0.3cm} Premium Tax Credit" 
			 r7 "\hspace{0.3cm} Cost-Sharing Reductions" 
			 r8 "\hspace{0.3cm} Individual Penalty" 
			 r9 "\hspace{0.3cm} Medicaid"  
			 r10 "\hspace{0.3cm} ESI Tax Exclusion"
			 c11 "\midrule \textbf{Total}") 
			 nonumber 
		refcat(r1 " \textbf{2017}" r6 "\textbf{2018}", nolabel)
		postfoot(\midrule                         
				\multicolumn{4}{p{\columnwidth}}{\tiny{\emph{Notes:} The table provides a rough estimate of the indirect state and federal budgetary costs of the intervention for 45-64 year-olds that were uninsured during the prior year.
				The estimates account for costs arising from claiming of the Premium Tax Credit (PTC)`semicolon' Cost Sharing Reductions (CSR)`semicolon' federal and state costs of Medicaid coverage`semicolon' foregone federal tax revenue from reductions
				in the individual mandate penalty that were paid`semicolon' and foregone federal and state tax revenue from income tax exclusions for employer-provided health insurance. For each cost category, Column 1 reports the average
				per-month cost. Column 2 reports the estimated effect of the intervention for the corresponding behavior or coverage type for the relevant year. Unless noted, all intervention effect estimations are derived from regressions
				that limit the sample to 45-64 year-olds that were uninsured during at least one of the first 11 months in 2016. We focus on effects of the intervention on individual coverage and/or behavior, although the responses of others
				in the same household could also affect the amount of PTC, CSR, penalty, and ESI tax exclusion. Column 3 reports the estimated effect of the intervention on each cost source. The average per-month costs reported in Column 1 are
				calculated as follows.

				PTC: Total PTC is the amount of advanced PTC associated with primary filers aged 45-64 years-old plus additional PTC claimed on returns minus repayments reported on returns. The average per-month cost is obtained 
				by dividing total PTC costs by the total number of months of exchange coverage among 45-64 years old. The intervention effect refers to the effect of the intervention on months of Exchange coverage. 

				CSR: In 2017, cost sharing reductions resulted in individuals with lower incomes being able to purchase higher actuarial values (AV) policies at the same price as the regular 70 AV. The upgraded AV plans were 94\%
				AV for individuals below 150\% FPL, 87\% AV for individuals between 150-200\% FPL, and 73\% AV for individuals between 200-250\% FPL. Since regular silver plans are 70\% AV, we impute cost sharing as the
				product of total payments for Second Lowest Cost Silver Plans (SLCSP) on Form 1095A and the increase in AV for the specific FPL group relative to 70\% AV, all divided by 70\%. For example, the cost for taxpayers
				below 150\% FPL was calculated as total SLCSP*(94\%-70\%)/70\%. We then obtain the average CSR cost per month by summing up the total CSR as described before and dividing it by the number of people between ages
				45-64 under 250\% FPL. We also obtained the intervention effect using the eligible population (45-64 under 250\% FPL).  In 2018, CSR was not paid and therefore had a budgetary cost of zero. The coverage effect 
				refers to the effect of the intervention on months of Exchange coverage among individuals with income below the 250\% FPL. Contribution to costs (Column 3) is the product of Columns 1 and 2, the share of 45-64
				year-olds eligible for cost-sharing because of income below 250\% FPL (approximately 0.545), and a 90\% CSR take-up rate reported in DeLeire et al. (2017). 

				Penalty: The contribution of the penalty to costs is derived from a regression of the reported penalty on the intervention among 45-64 year-olds that were uninsured during at least one of the first 11 months of
				2016. 

				Medicaid: Annual Medicaid costs for 2017 and 2018 are calculated from average annual Medicaid costs for adults by state in 2014, reported by KFF (__), inflated by the percent growth between 2014 and 2017 or 2018
				in per-person Medicaid costs reported by NHE (__). Medicaid per-month costs are obtained by dividing the average annual cost by 12. 

				Employer exclusions: The federal and states costs of an increase in ESI coverage is due to a reduction in taxable income. For this calculation we assume that employers are indifferent between providing coverage
				or giving employees’ wages implying that the incidence fall entirely on employees. Because ESI premiums are excluded from income and payroll taxes, the lost tax revenue equals the product of the premium amount 
				and the applicable marginal tax rate. We exclude payroll taxes from this calculation because changes in government revenue from this source are offset by reductions in future Social Security payments. For purposes
				of this analysis, we rely on the average cost of ESI premium per enrollee reported in NHE (__). The average per-month cost of the ESI exclusion is then obtained by multiplying this premium by a combined federal
				and state marginal tax rate of 17\% in 2017 and 14\% in 2018, and dividing by 12.}}
				\end{tabular}}                                                                                           
				\end{table});
#delim cr



/* ====================================================
Table A.XIX: Analyses Relating to Potential Exclusion Restriction Violations
=======================================================*/

estimates clear
eststo clear 

forval c = 1/2{
estimates use "$path/Estimates/mortality_main_052020.ster", number(`c')
eststo f`c'
}

forval c = 1/5{
estimates use "$path/Estimates/exclusion_rest_061720.ster", number(`c')
eststo c`c'
}

local semicolon = ";"

* .tex
#delimit ;
esttab f1 f2 c1 c2 c3 c4 using "$output/Exclusion Restriction Checks.tex", replace 
	nogaps label noobs eqlabels(none) collabel(none) nonumber nomtitles  
	b(3) se(3) transform(treatment @*100 100 , pattern(1 1 0 1 1 1)) 
	nostar nocons
	keep(treatment)
	varlabel(treatment "Treated")
	stats(ymean N, fmt(3 %15.0fc) label("Control Mean" "Observations"))
	prehead(\begin{table}[htbp]
			\caption{Analyses Relating to Potential Exclusion Restriction Violations} 
			\makebox[\textwidth][c]{
			\centering
			\begin{tabular}{l*{6}{c}}
			\toprule
			& \multicolumn{1}{c}{(1)} &  \multicolumn{1}{c}{(2)} &  \multicolumn{1}{c}{(3)} & \multicolumn{1}{c}{(4)} &  \multicolumn{1}{c}{(5)} &  \multicolumn{1}{c}{(6)}   \\ \cmidrule(lr){2-7} 
			& \multicolumn{1}{c}{Prior-Year} & \multicolumn{1}{c}{Mortality Among} & \multicolumn{1}{c}{Average}   & \multicolumn{1}{c}{ESI} & \multicolumn{1}{c}{ESI}  & \multicolumn{1}{c}{First Year} \\  
			& \multicolumn{1}{c}{Mortality} & \multicolumn{1}{c}{Prior-Year} & \multicolumn{1}{c}{Penalty}   & \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Coverage}  & \multicolumn{1}{c}{Mortality} \\  
			& \multicolumn{1}{c}{(2016)} & \multicolumn{1}{c}{Insured} & \multicolumn{1}{c}{}   & \multicolumn{1}{c}{(2017)} & \multicolumn{1}{c}{(2018)} & \multicolumn{1}{c}{(2017)} \\  
			\midrule)
	postfoot(\midrule                       
			\multicolumn{7}{p{5.8in}}{\footnotesize{\emph{Notes:} The table presents analyses relating to potential violations of the exclusion restriction. Column 1 reports the effect of the intervention on mortality during 2016.
			Column 2 reports the effect of the intervention on mortality during 2017-18 among individuals that were enrolled in coverage during each of the first 11 months of 2016. Column 3 reports the effect of the intervention
			on the reported individual mandate penalty, averaged over tax years 2017 and 2018 and winsorized at the 1st and 99th percentile. Columns 4 and 5 report the effect of the intervention on whether the individual enrolled
			in one month or more of employer-sponsored coverage during 2017 or 2018, respectively. Column 6 reports the effect of the intervention on mortality in 2017.  In all columns other than columns 3, the units are percentage
			points (0-100). All columns are limited to individuals between the ages of 45-64 at the end of 2017. All columns other than column 2 exclude individuals with full coverage in January through November of 2016. Standard
			errors, reported in parentheses, are clustered by household.}}                        
			\end{tabular}}
			\end{table});
#delimit cr	






/* ================================
Table A.XX: Effect of Intervention on Middle Age Mortality by Treatment Arm
===================================*/
estimates clear
eststo clear 


estimates use "$path/Estimates/treatment_arms_060820.ster", number(5)
eststo c5
estadd scalar p_value_f_stat = Ftail(e(df_m),e(df_r),e(F)) 
estadd scalar f_stat = e(F)

local semicolon= ";"


#delimit ;
esttab c5 using "$output/Mortality Effect by Treatment Arms.tex", replace 
	b(3) se(3) transform(@*100 100) 
	nostar booktabs nogaps label noobs eqlabels(none) nonumbers nomtitles nodepvars collabels(none) mgroups(none)
	keep(treatment early nonpersonalize exemption_info spanish)  
	order(treatment early nonpersonalize exemption_info spanish)
	varl(treatment "Treatment" nonpersonalize "Treatment $\times$ Non-Personalized"  
		early "Treatment $\times$ Early" exemption_info "Treatment $\times$  Exemption Info" 
		spanish "Treatment $\times$ Spanish" )  
	stats (f_stat p_value_f_stat ymean N, fmt(3 3 3  %15.0fc) label("Joint test (F-stat)" "Joint test (p-value)" "Control mean" "Observations"))  
	prehead(\begin{table}[htbp]
			\centering              
			\caption{Effect of Intervention on Middle Age Mortality by Treatment Arm}                                               
			\begin{tabular}{l*{1}{c}}                   
			\toprule                      
			& \multicolumn{1}{c}{Mortality} \\    
			\midrule)
	postfoot(\midrule          
			\multicolumn{2}{p{3in}}{\footnotesize{\emph{Notes:} The table reports the effect of the intervention on mortality based on which treatment arm a taxpayer was assigned.
			The outcome indicates mortality during 2017-18`semicolon' units are percentage points (0-100). The base treatment contained a personalized estimate of the 2017 household penalty
			for lacking coverage, was sent during the mid-January mailing, and did not include information about applying for an exemption. Treatment $\times$ Early indicates being sent 
			a letter during the late-November mailing. Treatment $\times$ Non-Personalized indicates being sent a letter without a personalized 2017 penalty estimate. Treatment $\times$ Exemption
			Info indicates being sent a letter with information about applying for an exemption from the penalty. Treatment $\times$ Spanish indicates that the letter included a Spanish
			language translation. Sample letters, corresponding to the different treatment arms, are contained in Appendix Figure _. The joint test corresponds to the null of equality
			in the mortality effect across treatment arms. The table limits the analysis to individuals between the ages of 45 and 64 at the end of 2017 and excludes individuals with full
			coverage in January through November of 2016. Standard errors, reported in parentheses,	are clustered by household. }}
			\end{tabular}                                         
			\end{table}) ;
#delimit cr






/* ================================
Table A.XXI: Effect of Intervention on Plan Costs
===================================*/

estimates clear
eststo clear

forval c = 1/4{
	estimates use "$path/Estimates/excl_rest_cov_quality_053020_v2.ster", number(`c')
	eststo c`c'
}

* .tex
#delimit ;
esttab c1 c2 c3 c4 using "$output/Plan Cost Spillovers.tex", replace 
nogaps label noobs eqlabels(none) collabel(none) nonumber nomtitles  
b(3) se(3) 
	nostar 
	keep(treatment) 
	varl(treatment "Treated")  
	stats (ymean N, fmt(3 %15.0fc) label("Control mean" "Observations")) 
	prehead(\begin{table}[htbp]\centering
			\caption{Effect of Intervention on Plan Costs}
			\begin{tabular}{l*{4}{c}}
			\toprule
			& \multicolumn{1}{c}{(1)} &  \multicolumn{1}{c}{(2)}  &  \multicolumn{1}{c}{(3)} &  \multicolumn{1}{c}{(4)} \\ 
			\cmidrule(lr){2-5}  
			& \multicolumn{1}{c}{Exchange} & \multicolumn{1}{c}{Exchange} & \multicolumn{1}{c}{ESI} & \multicolumn{1}{c}{ESI} \\
			& \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Premiums} & \multicolumn{1}{c}{Coverage}& \multicolumn{1}{c}{Premiums} \\
			\midrule)
	postfoot(\midrule 
			\multicolumn{5}{p{4.75in}}{\footnotesize{\emph{Notes:} The table investigates the effect of the intervention on the cost of plans enrolled in, as a proxy for plan generosity. To avoid conflating changes in plan
			generosity with changes in enrollment, the analysis reported in the table is restricted to households in which all members were enrolled in full coverage during the prior year. Columns 1 and 3 confirm the
			lack of an observed effect of the intervention for this group on either ESI or Exchange enrollment. Columns 2 and 4 investigate whether the intervention affected plan cost and show no evidence that it did. 
			All of the reported analyses are conducted at the tax return level. In columns 1 and 3, the outcome is months of the specified form of coverage during 2017-18. In columns 2 and 4, the outcome is the average 
			premium amount of the specified	type of coverage per household member. Plan premiums are averaged over 2017 and 2018. The number of household members is equal to the number of taxpayers plus the number of dependents reported on the 2017
			or 2018 tax return. Columns 2 and 4 are restricted to households in which at least one household member is enrolled in the specified form of coverage. Exchange plan premiums are calculated by summing up
			total purchased premium based on Form 1095A reporting. ESI plan premiums are calculated by summing up total reported ESI premiums as reported in box 12 under code DD on the W-2. All columns are limited to
			households in which the primary filer is between the ages of 45-64 and in which all household members were enrolled in coverage during each of the first 11 months of 2016. Standard errors, reported in
			parentheses are clustered by household.}} 
			\end{tabular}                         
			\end{table}) ;
#delimit cr


/* =======================================
Table A.XXII: Household Spillovers
==========================================*/


estimates clear
forval c = 1/3 {
	estimates use "$path/Estimates/spillovers_052720.ster", number(`c')
	eststo c`c'
}

local semicolon ";"


* .tex
#delimit ;
esttab c1 c2 c3 using "$output/Househould Spillovers.tex", replace 
nogaps label noobs eqlabels(none) collabel(none) nonumber nomtitles  
	b(3) se(3) transform(@*100 100, pattern(0 0 1))
	nostar 
	keep(treatment) 
	varl(treatment "Treated")  
	stats (ymean N, fmt(3 %15.0fc) label("Control mean" "Observations")) 
	prehead(\begin{table}[htbp]\centering
			\caption{Household Spillovers}
			\begin{tabular}{l*{3}{c}}
			\toprule
			& \multicolumn{1}{c}{(1)} &  \multicolumn{1}{c}{(2)}  &  \multicolumn{1}{c}{(3)}    \\ \cmidrule(lr){2-4}  
			& \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Coverage}& \multicolumn{1}{c}{Mortality} \\
			& \multicolumn{1}{c}{(Prior-Year Insured)} & \multicolumn{1}{c}{(Prior-Year Uninsured)}& \multicolumn{1}{c}{(Prior-Year Insured)} \\
			\midrule)
	postfoot(\midrule 
			\multicolumn{4}{p{6in}}{\footnotesize{\emph{Notes:} The table investigates the presence of within-household spillovers in the effect of intervention-induced coverage on mortality. The reported analyses are limited
			to households in which one household member was between the ages of 45 and 64 at the end of 2017 and was enrolled in coverage during each of the first 11 months of 2016, and in which another household member was
			not enrolled in coverage during one or more of the first 11 months of 2016. Columns 1 and 3 report results for individuals in the former category - i.e., 45-64 year-olds with full prior-year coverage. Column 2 reports
			results for individuals in the latter category - i.e., individuals of any age without full prior-year coverage. In columns 1 and 2, the outcome is months of coverage enrolled in during 2017-18. In column 3, the outcome
			is mortality in 2017-18`semicolon' units are percentage points (0-100). Standard errors, reported in parentheses are clustered by household. }} 
			\end{tabular}                         
			\end{table}) ;
#delimit cr




/* ================================
Table A.XXIII: Effect of Coverage on Middle Age Mortality - Robustness Checks
===================================*/

estimates clear
eststo clear 

foreach c of numlist 1/7{
estimates use "$path/Estimates/2sls_robustness_052620.ster", number(`c')
eststo c`c'
}


#delimit ;
esttab c1 c2 c3 c4 c5 c6 c7 using "$output/2SLS - Robustness.tex", replace 
	nostar booktabs nogaps label noobs eqlabels(none) nonumbers nomtitles nodepvars collabels(none) mgroups(none)  nonotes 
	b(3) se(3) transform(@*100 100) 
	nostar
	keep(covered1718) 
	varlabel(covered1718 "Covered Months")  
	stats (ymean N , fmt(3 %15.0fc) label("Control mean" "Observations")) 
	prehead(\begin{table}[htbp]    
			\caption{Effect of Coverage on Middle Age Mortality - Robustness Checks}   
			\makebox[\textwidth][c]{
			\centering                      
			\begin{tabular}{l*{7}{c}}                  
			\toprule             
			& \multicolumn{1}{c}{(1)} &  \multicolumn{1}{c}{(2)} & \multicolumn{1}{c}{(3)}  &  \multicolumn{1}{c}{(4)} &  \multicolumn{1}{c}{(5)} &  \multicolumn{1}{c}{(6)}  &  \multicolumn{1}{c}{(7)} \\                
			\cmidrule(lr){2-8}                                          
			& \multicolumn{1}{c}{Demographic} & \multicolumn{1}{c}{Randomization} & \multicolumn{1}{c}{Ages} & \multicolumn{1}{c}{Ages} & \multicolumn{1}{c}{No Prior-Year} & \multicolumn{1}{c}{No Prior-Year} & \multicolumn{1}{c}{Multiple} \\      
			& \multicolumn{1}{c}{Controls} & \multicolumn{1}{c}{Strata} & \multicolumn{1}{c}{40-64} & \multicolumn{1}{c}{50-64}  & \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Coverage} & \multicolumn{1}{c}{Instruments} \\
			& \multicolumn{1}{c}{} & \multicolumn{1}{c}{Controls} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{}  & \multicolumn{1}{c}{Exclusion} & \multicolumn{1}{c}{Exclusion} & \multicolumn{1}{c}{} \\
			\midrule)
	postfoot(\midrule      
			\multicolumn{8}{p{7.5in}}{\footnotesize{\emph{Notes:} The table reports robustness checks relating to the IV estimate of coverage on mortality. In all columns, the outcome is mortality in 2017-18. Units are percentage
			points (0-100). In all columns, the variable that is instrumented for is months of coverage during 2017-18. Column 1 reports results from a two-stage least squares specification that controls for the demographic
			and geographic covariates described in the notes to Appendix Table _.  	Column 2 reports results from a linear dependent variable model that controls for randomization strata indicators described in the notes to Appendix
			Table _`semicolon' the specification omits 78 individuals in singleton randomization strata.  Columns 3 and 4 limit the analysis to individuals, who, at the end of 2017, were between the ages of 40-64 and 50-64, respectively.
			Columns 5 and 6 but do not exclude individuals based on their 2016 coverage. Column 5 replicates the main IV analysis. Column 6 reports results from a two-stage least squares specification that controls for whether an individual was enrolled in coverage during
			each of the first 11 months of 2016 and that includes as an additional instrument for coverage an interaction between this indicator and the indicator for treatment group assignment. Column 7 reports results from 
			a two-stage least squares specification that instruments for coverage with 8 binary indicators reflecting assignment to the 8 treatment arms. All columns other than 3 and 4 are limited to individuals between the
			ages of 45-64 at the end of 2017. All columns other than 5 and 6 exclude individuals with full coverage in January through November of 2016. Standard errors, reported in parentheses are clustered by household.}}
			\end{tabular} }                
			\end{table});
#delimit cr	


/* ================================
Table A.XXIV: Heterogeneity in Effect of Coverage on Middle Age Mortality
===================================*/


estimates clear
eststo clear

forval c = 1/8{
	estimates use "$path/Estimates/2sls_heterogeneity_052920.ster", number(`c')
	eststo c`c'
}


#delimit ;
esttab c1 c2 c3 c4 c5 c6 c7 c8 using "$output/2SLS Heterogeneity.tex", replace 
	nogaps label noobs eqlabels(none) collabel(none) nonumber nomtitles  
	b(3) se(3) 
	nostar 
	keep(covered1718)  varl(covered1718 "Covered Months")  
	transform(@*100 100) 
	stats (ymean N, fmt(3 %15.0fc) label("Control mean" "Observations"))
	prehead(\begin{table}[htbp]\centering
			\caption{Heterogeneity in Effect of Coverage on Middle Age Mortality}
			\makebox[\textwidth][c]{ 
			\centering
			\begin{tabular}{l*{8}{c}}                       
			\toprule            
			& \multicolumn{1}{c}{(1)} & \multicolumn{1}{c}{(2)} & \multicolumn{1}{c}{(3)} & \multicolumn{1}{c}{(4)}  & \multicolumn{1}{c}{(5)} & \multicolumn{1}{c}{(6)} & \multicolumn{1}{c}{(7)} & \multicolumn{1}{c}{(8)} \\ \cmidrule(lr){2-9}        
			& \multicolumn{1}{c}{Income/FPL} & \multicolumn{1}{c}{Income/FPL} & \multicolumn{1}{c}{Expansion}  & \multicolumn{1}{c}{Non-Expansion} &\multicolumn{1}{c}{Men}  &\multicolumn{1}{c}{Women} & \multicolumn{1}{c}{Married} & \multicolumn{1}{c}{Not Married} \\                         
			& \multicolumn{1}{c}{$<$ 138 \%} & \multicolumn{1}{c}{$>$ 138  \%} & \multicolumn{1}{c}{State} & \multicolumn{1}{c}{State}  & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{}  \\
			\midrule)  
	postfoot(\midrule 		
			\multicolumn{9}{p{8in}}{\footnotesize{\emph{Notes:} The table reports heterogeneity in the effect of coverage on mortality by conducting the IV analysis separately across the specified dimensions. In all
			columns, the outcome is mortality during 2017-18. Units are percentage points (0-100). In all columns, an indicator for treatment group assignment is used as an instrument for the months of coverage enrolled in
			during 2017-18. Columns 1 and 2 divide the sample based on whether an individual's 2015 household income exceeded the 138\% Federal Poverty Line threshold for Medicaid eligibility. Columns 3 and 4 divide the sample
			based on whether the individual's 2015 residence was in a state that had expanded Medicaid under the Affordable Care Act by the start of 2017. Columns 5 and 6 divide the sample by gender. Columns 7 and 8 divide the 
			sample based on the marital status reflected on the 2015 return. All columns are limited to individuals between the ages of 45 and 64 at the end of 2017 and exclude individuals with full coverage in January through
			November of 2016. Standard errors, reported in parentheses, are clustered by household.}}        
			\end{tabular}}
			\end{table}) ;
			
			

/* ============================================================
Table A.XXVI: Baseline Mortality Among Middle Age Adults by Extensive-Margin Coverage Effect
===============================================================*/
			
			
estimates use "$path/Estimates/baseline_mort_1718_060920.ster", number(1)

nlcom (Nevertakers: 		1 - (_b[B] + _b[Z_B])) /// 
	  (Alwaystakers: 		_b[B]) ///
	  (Compliers: 			_b[Z_B]) /// 
	  (Y_c: (_b[Z_A]*(_b[B]+ _b[Z_B] - 1) + _b[Z_B]*_b[A])/_b[Z_B]) /// complier mortality
	  (Y_n: _b[A] + _b[Z_A]), post  /// never-takers
	  

local complier_mort_b = _b[Y_c]*100

local never_takers_mort_b = _b[Y_n]*100

local complier_share_b = _b[Compliers]*100

local never_takers_share_b = _b[Nevertakers]*100



estadd mat c1 = [`complier_mort_b' ]
estadd mat c2 = [`complier_share_b' ]
estadd mat c3 = [`never_takers_mort_b']
estadd mat c4 = [`never_takers_share_b']


#delimit ;

esttab using "$output/Baseline Mortality.tex", cells("c2(fmt(3)) c1(fmt(3)) c4(fmt(3)) c3(fmt(3))")  
		nostar booktabs nogaps label noobs eqlabels(none) nonumbers nomtitles nodepvars collabels(none) mgroups(none) nolines nonotes replace
		prehead(\begin{table}[htbp]                      
				\caption{Baseline Mortality Among Middle Age Adults by Extensive-Margin Coverage}                            
				\makebox[\textwidth][c]{ 
				\centering          
				\begin{tabular}{l*{4}{c}}           
				\toprule                                      
				& \multicolumn{1}{c}{(1)} &  \multicolumn{1}{c}{(2)} & \multicolumn{1}{c}{(3)}  &  \multicolumn{1}{c}{(4)}  \\                                 
				\cmidrule(lr){2-5}                                                                   
				& \multicolumn{2}{c}{Extensive-Margin Compliers} & \multicolumn{2}{c}{Extensive-Margin Never-Takers } \\ 
				\cmidrule(lr){2-3} \cmidrule(lr){4-5}                                                                    
				& \multicolumn{1}{c}{Share} & \multicolumn{1}{c}{Baseline} & \multicolumn{1}{c}{Share} & \multicolumn{1}{c}{Baseline} \\
				& \multicolumn{1}{c}{} & \multicolumn{1}{c}{Mortality} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{Mortality} \\
				\midrule)
		varl(c1 "") 
		postfoot(\midrule
				\multicolumn{5}{p{5in}}{\footnotesize{\emph{Notes:} The table reports the estimated population share and baseline mortality rate for extensive-margin compliers and never-takers. Units are percentage points (0-100).
				Extensive-margin compliers refer to individuals that would enroll in zero months of coverage if assigned to the control and in positive months of coverage if assigned to the intervention. Extensive-margin never-takers 
				refer to individuals that would enroll in zero months of coverage if assigned to the control or to the treatment. Baseline mortality refers to the share of the specified group that would die during 
				2017-18 if enrolled in zero months of coverage during that time period. For calculation details, refer to Online Appendix _. All columns are limited to individuals between the ages of 45 and 64 at 
				the end of 2017 and exclude individuals with full coverage in January through November of 2016. }}                
				\end{tabular}}
				\end{table});
				
#delimit cr		



/* ============================================================
Table A.XXVII: Comparison to Estimated Mortality Effects from Prior Research
===============================================================*/

clear all
estimates clear
eststo clear 

estimates use "$path/Estimates/2sls_main_052920.ster", number(3)
eststo c1
mat aca = nullmat(aca) \ _b[treatment]*100 \ _se[treatment]*100 

estimates use "$path/Estimates/2sls_main_052920.ster", number(2)
eststo c2
mat aca = nullmat(aca) \ _b[treatment] \ _se[treatment]

estimates use "$path/Estimates/2sls_main_052920.ster", number(4)
eststo c3
mat aca = nullmat(aca) \ _b[covered1718]*100  \ _se[covered1718]*100 \ (_b[covered1718] +1.96*_se[covered1718])*100 \ (_b[covered1718] - 1.96*_se[covered1718])*100

use "$path/Data/Prior Research Comparison - 052020.dta", clear
svmat aca

estimates clear
eststo clear 

replace itt_acr_noweights1 = aca1 if _n == 7 & itt_acr_noweights1 > aca1
replace itt_acr_aca_weights1 = aca1 if _n == 7 & itt_acr_aca_weights1 > aca1

mkmat aca1, matrix(aca)
mkmat itt_acr_noweights1, matrix(itt_acr_noweights)
mkmat itt_acr_aca_weights1, matrix(itt_acr_aca_weights)
mkmat miller1, matrix(miller)

estadd matrix  c1 = [aca[1,1],aca[3,1],aca[5,1]]
estadd matrix c1_se = [aca[2,1],aca[4,1],aca[6,1]]

estadd matrix  c2 = [itt_acr_noweights[1,1],itt_acr_noweights[3,1],itt_acr_noweights[5,1]]
estadd matrix  c2_se = [itt_acr_noweights[2,1],itt_acr_noweights[4,1],itt_acr_noweights[6,1]]

estadd matrix  c3 = [itt_acr_aca_weights[1,1],itt_acr_aca_weights[3,1],itt_acr_aca_weights[5,1]]
estadd matrix  c3_se = [itt_acr_aca_weights[2,1],itt_acr_aca_weights[4,1],itt_acr_aca_weights[6,1]]

estadd matrix c4 = [miller[1,1],miller[3,1],miller[5,1]]


local li_c1 = aca[8,1]
local li_c1: di %05.3f `li_c1'

local ui_c1 = aca[7,1]
local ui_c1: di %05.3f `ui_c1'

local li_c2 = itt_acr_noweights[8,1]
local li_c2: di %05.3f `li_c2'

local ui_c2 = itt_acr_noweights[7,1]
local ui_c2: di %05.3f `ui_c2'

local li_c3 = itt_acr_aca_weights[8,1]
local li_c3: di %05.3f `li_c3'

local ui_c3 = itt_acr_aca_weights[7,1]
local ui_c3: di %05.3f `ui_c3'

local ds "//"

#delimit ;
esttab using "$output/Comparison to Prior Research.tex", cells("c1(fmt(3)) c2(fmt(3)) c3(fmt(3)) c4(fmt(3))" "c1_se(fmt(3)par) c2_se(fmt(3)par) c3_se(fmt(3)par)")  
		nostar booktabs nogaps label noobs eqlabels(none) nonumbers nomtitles nodepvars collabels(none) mgroups(none) nolines nonotes replace
		prehead(\begin{table}[htbp]\centering        
				\caption{Comparison to Estimated Mortality Effects from Prior Research}                       
				\begin{tabular}{l*{4}{c}}                         
				\toprule                        
				& \multicolumn{1}{c}{(1)} &  \multicolumn{1}{c}{(2)} &  \multicolumn{1}{c}{(3)} &  \multicolumn{1}{c}{(4)} \\ \cmidrule(lr){2-5}                 
				& \multicolumn{1}{c}{ ACA Penalty} & \multicolumn{1}{c}{Oregon Study} & \multicolumn{1}{c}{Oregon Study} & \multicolumn{1}{c}{Medicaid}   \\ 
				& \multicolumn{1}{c}{(This Study)} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{(Age-Weighted)} & \multicolumn{1}{c}{Expansion}  \\ 
				\midrule
				\hline)
		varl(c1 "Intent-to-Treat" 
			 c2 "First Stage" 
			 c3 "IV Estimate" ) 
		postfoot(Overlapping CI  &  &   [`li_c2',`ui_c2']&    [`li_c3',`ui_c3']&      \\   
				\midrule
				\multicolumn{5}{p{\columnwidth}}{\footnotesize{\emph{Notes:}  The tables compares findings from the current study (column 1) to those derived from the Oregon health insurance study (columns 2 and 3) and from the ACA 
				Medicaid expansion, as reported by Miller et al. (2019) (column 4). Column 1 reports analyses from the current study that are described in Table _. The Oregon study results are calculated from the public-use 
				replication data, downloaded from https:`ds'www.nber.org/oregon/4.data.html. We use the 20\% subsample of the Oregon data that contains survey data on monthly enrollment, along with the corresponding survey weights. 
				Column 3 adjusts the Oregon survey weights to reflect the age distribution of our mortality analysis sample. The standard errors reported in columns 2 and 3 are clustered by household. The Miller et al. results are
				calculated from estimates reported in the draft dated July 10, 2019. The coverage and mortality effect estimates are calculated from their Table 1 (columns 3 and 4) and reflect the event-study coefficients corresponding
				to Year 0 and Year 1 (post-expansion). We do not calculate standard errors or confidence intervals for the Miller et al. analysis because we lack the required microdata. The results from our study are drawn from the 
				specifications with control variables. The intent-to-treat results correspond to the effects of the respective interventions on 1.5-yr mortality (columns 2 and 3) and 2-yr mortality (columns 1 and 4). The units are
				percentage points (0-100). The first stage results correspond the effect of the respective interventions on months of coverage enrolled in during the first year post-intervention (columns 2 and 3) and during the
				first 2 years post-intervention (column 1 and 4). To make the Oregon IV results comparable to ours, the first stage is calculated using survey data on monthly enrollment in coverage. For the Miller et
				al. study, the first stage is calculated from the change in the share of uninsured individuals, under the assumption that each individual who obtains coverage because of the treatment does so for each month during
				the year. The IV estimate for each study is obtained by dividing the intent-to-treat by the first stage. Units are percentage points (0-100). For the Oregon results, the intent-to-treat is first scaled by 12/18
				before dividing by the first stage so that both the intent-to-treat and first stage reflect a 12-month period. The row titled ``Overlapping CI'' presents the overlap between our estimated confidence interval for the
				effect of coverage on mortality and the confidence interval derived from the Oregon study results. }}                
				\end{tabular}                                                
				\end{table});
				
#delimit cr		

